JSPM

@jeanbono/json-pathfinder

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q19304F
  • License ISC

Find the line number in a json string from a json path

Package Exports

  • @jeanbono/json-pathfinder
  • @jeanbono/json-pathfinder/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@jeanbono/json-pathfinder) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

JSON Pathfinder

JSON Pathfinder is a javascript library dedicated to finding the line number for a given json path in a json string

Installation

Use the package manager npm to install json-pathfinder.

npm -i @jeanbono/json-pathfinder

Usage

import { jsonPathfinder } from '@jeanbono/json-pathfinder';

const jsonString = '{\n\
    "foo": "bar",\n\
    "baz": [{ \n\
        "hello": "world" \n\
    }]\n\
}';

// parse the json string
const pathfinder = jsonPathfinder(jsonString);

// returns line number 4
console.log(pathfinder('baz[0].hello'));

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

ISC