2.2.1 • Published 4 months ago

json-p3 v2.2.1

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

import { jsonpath } from "json-p3";

const data = {
  users: [
    { name: "Sue", score: 100 },
    { name: "John", score: 86 },
    { name: "Sally", score: 84 },
    { name: "Jane", score: 55 },
  ],
};

const nodes = jsonpath.query("$.users[?@.score < 100].name", data);
console.log(nodes.values()); // [ 'John', 'Sally', 'Jane' ]

Links

Bundles

JSON P3 is written in TypeScript, compiled to JavaScript using Babel, and bundled using Rollup. The following, included bundles target defaults, maintained node version, as defined by Browserslist.

JSON P3 has zero runtime dependencies.

BundleDescription
json-p3.cjs.jsA CommonJS formatted bundle.
json-p3.esm.jsAn ECMAScript module formatted bundle.
json-p3-iife.jsA bundle formatted as an Immediately Invoked Function Expression.
json-p3-iife.min.jsA minified bundle formatted as an Immediately Invoked Function Expression.

Compliance Environment Variables

These environment variables control the location of the compliance test suite under test and if nondeterministic object iteration is enabled for those tests.

Environment VariableDescription
JSONP3_CTS_PATHThe path to cts.json used by compliance.test.ts. Defaults to tests/path/cts/cts.json.
JSONP3_CTS_NONDETERMINISTICWhen set to true, enables nondeterministic iteration of JSON objects for compliance.test.ts. Defaults to false.

Contributing

Please see Contributing to JSON P3

License

json-p3 is distributed under the terms of the MIT license.

1.3.5

7 months ago

2.2.1

4 months ago

2.2.0

4 months ago

2.1.1

5 months ago

2.1.0

5 months ago

2.0.0

6 months ago

1.3.4

11 months ago

1.3.3

1 year ago

1.3.2

1 year ago

1.3.1

1 year ago

1.3.0

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago

0.3.1

1 year ago

0.3.0

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago