5.0.1 • Published 2 years ago

jsonpointer v5.0.1

Weekly downloads
1,846,097
License
MIT
Repository
github
Last release
2 years ago

JSON Pointer for Node.js

This is an implementation of JSON Pointer.

CLI

Looking to filter JSON from the command line? Check out jsonpointer-cli.

Usage

var jsonpointer = require('jsonpointer');
var obj = { foo: 1, bar: { baz: 2}, qux: [3, 4, 5]};

jsonpointer.get(obj, '/foo');     // returns 1
jsonpointer.get(obj, '/bar/baz'); // returns 2
jsonpointer.get(obj, '/qux/0');   // returns 3
jsonpointer.get(obj, '/qux/1');   // returns 4
jsonpointer.get(obj, '/qux/2');   // returns 5
jsonpointer.get(obj, '/quo');     // returns undefined

jsonpointer.set(obj, '/foo', 6);  // sets obj.foo = 6;
jsonpointer.set(obj, '/qux/-', 6) // sets obj.qux = [3, 4, 5, 6]

var pointer = jsonpointer.compile('/foo')
pointer.get(obj)    // returns 1
pointer.set(obj, 1) // sets obj.foo = 1

Testing

$ npm test
All tests pass.
$

Node.js CI

Author

(c) 2011-2021 Jan Lehnardt jan@apache.org & Marc Bachmann https://github.com/marcbachmann

Thanks to all contributors.

License

MIT License.

is-my-json-validff-vue-jsonschema-form@galgotech/rjsf-coremace-json-schemavue3-ts-form-1react-jsonschema-form--ml@workbase/rjsf-coreschema-form-test@northek/react-json-schema-form-core@dat/better-ajv-errorsvjsf-yipiemballa-rjsfcoregotin-ui@frontoffice/rjsf-core@infinitebrahmanuniverse/nolb-jsonp@samsquatch/alteryx-components@samsquatch/service-titan-componentssklif-ui-kitsklif-api@everything-registry/sub-chunk-1988p149-tablesklif-uixml-stream-converteryilangchain@eccosolutions/rjsf-corevue3-json-schema-formvue3-json-schema-form-testvue3-jsonschemaform-lyvue-jsonschema-form-nokweb-component-tester-bundlevue3-test-formwc-starterkitwetzelvue3-ts-formwow.js-juzitooqing-react-jsonschema-formtoolbeam-clitoyakotms-llm-kitteapackage-tatespoorman297tv4-reportertypographic-orphanzhf-vue3-formv3jsfvjsf-arco-designvjsf-arco-design-corevjsf-dpcvjsf-drevjsf-form-kunvjsf-hiottervjsf-imoocvjsf-testvjsf-test001vjsfwww9999virtual-tour-guidevcloudcam-playkit-js-hlsunitx-ui@inovando-boletos/boleto@infinity-interactive/jsonschematicswagger-mock-validatorswagger-pact@ericlewis/langchain@imtf/rjsf-core@imnfeng/vue3-form-core@digitalbazaar/oid4-clientopenapi-document-local-ref-resolveropenapi-diff@datacamp/rjsf-coreodgn-entity@deskpro/react-forms@digitalgp/langchain-oracle@dnlowman/dangercombiner-liboas-reduceroascli-components@deathbeds/wxyz-corediffsonjsdigital-keyboard-demosqs3docsonreactofy-css-libraryresponsis-gantt-task-reactreact-solid-gradient-pickerrjsf-core-fix-emptyschema-json-form-zzhsnobject2solregex2style-guide-mainstella-json-validator@modular-service/generator-swagger@minocoko/rjsf-core@matheus-santos-souza/langchainjs-oracle-v2@mblode/react-native-feather@mayuriachewad/pickupbiz-npm-package@karolf/langchain@kickstartds/jsonschema-utils@lynicon/schema-form@pactflow/swagger-mock-validator@oscarbarrett/danger
5.0.1

2 years ago

5.0.0

2 years ago

4.1.0

4 years ago

4.0.1

7 years ago

4.0.0

8 years ago

3.0.1

8 years ago

3.0.0

9 years ago

2.0.0

9 years ago

1.1.0

11 years ago

1.0.1

13 years ago

1.0.0

13 years ago