Socket
Book a DemoInstallSign in
Socket

json-path-position-info

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-path-position-info

Module to provide the position info of a JSONPath within a blob of JSON

latest
Source
npmnpm
Version
0.0.2
Version published
Weekly downloads
173
55.86%
Maintainers
1
Weekly downloads
 
Created
Source

json-path-position-info

Greenkeeper badge Module to provide the position info of a JSONPath within a blob of JSON

Usage

const jppi = require('json-path-position-info');

const json = {
  prop1: 'one',
  prop2: 2,
  prop3: {
    three: true
  },
  prop4: [
    {
      index: 1
    },
    {
      index: 2
    }
  ]
};

const data = jppi(json, 'prop3.three', '.', '  ');
console.log(data);

// Output: { source: '{\n  "prop1": "one",\n  "prop2": 2,\n  "prop3": {\n    "three": true\n  },\n  "prop4": [\n    {\n      "index": 1\n    },\n    {\n      "index": 2\n    }\n  ]\n}',
  line: 5,
  column: 5,
  pos: 46 }

Keywords

json

FAQs

Package last updated on 30 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts