1.0.67 • Published 6 months ago

search-in-json v1.0.67

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Search In Json (with unknown schema)

This is a simple tool to find the path of a key in a JSON object. You can use it to find the path of a key in a JSON object, and then use the path to get the value of the key.

Code SandBox Link

logo

Example

import { search } from 'search-in-json';
import { data } from './data';

console.log(
  search({
    data,
    text: 'order',
    debug: true,
    ignoreCamelCase: true,
  })
);

Exmple2 with regex

import { search } from 'search-in-json';
import { data } from './data';

console.log(
  search({
    data,
    debug: true,
    ignoreCamelCase: true,
    regex: /order/gi,
  })
);

Result Sample

{
  "result": [
    {
      "key": "_embedded.episodes[1].summary",
      "index": 239,
      "endIndex": 244
    },
    {
      "key": "_embedded.episodes[59].summary",
      "index": 137,
      "endIndex": 142
    }
  ]
}
1.0.6

6 months ago

1.0.62

6 months ago

1.0.61

6 months ago

1.0.66

6 months ago

1.0.65

6 months ago

1.0.64

6 months ago

1.0.63

6 months ago

1.0.67

6 months ago

1.0.5

8 months ago

1.0.4

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago