jsonpath-plus
Advanced tools
Comparing version 0.16.0 to 0.17.0
# jsonpath-plus changes | ||
## 0.17.0 (October 19, 2018) | ||
- Breaking change: With Node use, must now use | ||
`require('jsonpath-plus').JSONPath`. | ||
- Breaking change: Stop including polyfills for array and string `includes` | ||
(can get with `@babel/polyfill` or own) | ||
- Breaking change: Remove deprecated `JSONPath.eval` | ||
- License: Remove old and unneeded license portion from within source file | ||
(already have external file) | ||
- Fix: Support object shorthand functions on sandbox objects | ||
(`toString()` had not been working properly with them) | ||
- Enhancement: Add Rollup/Babel/Terser and `module` in `package.json` | ||
- Refactoring: Use ES6 features such as object shorthand | ||
- Linting: prefer const and no var | ||
- Testing: Replace custom server code with `node-static` and add `opn-cli`; | ||
mostly switch to ESM | ||
- npm: Update devDeps; add `package-lock.json`; remove non-functioning remark | ||
## 0.16.0 (January 14, 2017) | ||
@@ -4,0 +22,0 @@ |
{ | ||
"author": "Stefan Goessner", | ||
"name": "jsonpath-plus", | ||
"version": "0.17.0", | ||
"main": "dist/index-umd.js", | ||
"module": "dist/index-es.js", | ||
"description": "A JS implementation of JSONPath with some additional operators", | ||
@@ -32,3 +35,2 @@ "contributors": [ | ||
"license": "MIT", | ||
"version": "0.16.0", | ||
"repository": { | ||
@@ -40,14 +42,21 @@ "type": "git", | ||
"homepage": "https://github.com/s3u/JSONPath", | ||
"main": "./lib/jsonpath", | ||
"dependencies": {}, | ||
"engines": { | ||
"node": ">=0.8" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"eslint": "^1.10.3", | ||
"eslint-config-standard": "^4.4.0", | ||
"eslint-plugin-standard": "^1.3.1", | ||
"nodeunit": "0.9.0", | ||
"remark-lint": "^3.0.0", | ||
"remark": "^4.1.2" | ||
"@babel/core": "^7.1.2", | ||
"@babel/preset-env": "^7.1.0", | ||
"eslint": "^5.7.0", | ||
"eslint-config-standard": "^12.0.0", | ||
"eslint-plugin-import": "2.14.0", | ||
"eslint-plugin-node": "7.0.1", | ||
"eslint-plugin-promise": "4.0.1", | ||
"eslint-plugin-standard": "^4.0.0", | ||
"node-static": "^0.7.11", | ||
"nodeunit": "0.11.3", | ||
"opn-cli": "^3.1.0", | ||
"rollup": "0.66.6", | ||
"rollup-plugin-babel": "^4.0.3", | ||
"rollup-plugin-terser": "^3.0.0" | ||
}, | ||
@@ -59,10 +68,9 @@ "keywords": [ | ||
"scripts": { | ||
"eslint": "./node_modules/.bin/eslint test lib test-helpers", | ||
"remark": "./node_modules/.bin/remark -q -f .", | ||
"lint": "npm run eslint && npm run remark", | ||
"nodeunit": "./node_modules/.bin/nodeunit test", | ||
"test": "npm run lint && npm run nodeunit", | ||
"browser-test": "npm run lint && node ./test-helpers/nodeunit-server", | ||
"rollup": "rollup -c", | ||
"eslint": "eslint .", | ||
"nodeunit": "nodeunit test", | ||
"test": "npm run eslint && npm run nodeunit", | ||
"browser-test": "npm run eslint && opn http://localhost:8084/test/ && static -p 8084", | ||
"start": "npm run browser-test" | ||
} | ||
} |
108
README.md
@@ -15,3 +15,3 @@ # JSONPath Plus [![build status](https://secure.travis-ci.org/s3u/JSONPath.png)](http://travis-ci.org/s3u/JSONPath) | ||
```shell | ||
npm install jsonpath-plus | ||
npm install jsonpath-plus | ||
``` | ||
@@ -26,20 +26,36 @@ | ||
```js | ||
var JSONPath = require('jsonpath-plus'); | ||
var result = JSONPath({json: obj, path: path}); | ||
const {JSONPath} = require('jsonpath-plus'); | ||
const result = JSONPath({path: '...', json: ...}); | ||
``` | ||
For browser usage you can directly include `lib/jsonpath.js`; no Browserify | ||
For browser usage you can directly include `dist/index-umd.js`; no Browserify | ||
magic is necessary: | ||
```html | ||
<script src="lib/jsonpath.js"></script> | ||
<script> | ||
var result = JSONPath({path: path, json: obj}); | ||
</script> | ||
<script src="dist/index-umd.js"></script> | ||
<script> | ||
const result = JSONPath({path: '...', json: ...}); | ||
</script> | ||
``` | ||
You may also use ES6 Module imports (for modern browsers): | ||
```html | ||
<script type="module"> | ||
import JSONPath from './node_modules/jsonpath-plus/dist/index-es.js'; | ||
const result = JSONPath({path: '...', json: ...}); | ||
</script> | ||
``` | ||
Or if you are bundling your JavaScript (e.g., with Rollup), just use: | ||
```js | ||
import JSONPath from 'jsonpath-plus'; | ||
const result = JSONPath({path: '...', json: ...}); | ||
``` | ||
The full signature available is: | ||
```js | ||
var result = JSONPath([options,] path, json, callback, otherTypeCallback); | ||
const result = JSONPath([options,] path, json, callback, otherTypeCallback); | ||
``` | ||
@@ -58,8 +74,2 @@ | ||
The following format is now deprecated: | ||
```js | ||
jsonPath.eval(options, json, path); | ||
``` | ||
## Properties | ||
@@ -160,38 +170,38 @@ | ||
```json | ||
{ | ||
"store": { | ||
"book": [ | ||
{ | ||
"category": "reference", | ||
"author": "Nigel Rees", | ||
"title": "Sayings of the Century", | ||
"price": 8.95 | ||
}, | ||
{ | ||
"category": "fiction", | ||
"author": "Evelyn Waugh", | ||
"title": "Sword of Honour", | ||
"price": 12.99 | ||
}, | ||
{ | ||
"category": "fiction", | ||
"author": "Herman Melville", | ||
"title": "Moby Dick", | ||
"isbn": "0-553-21311-3", | ||
"price": 8.99 | ||
}, | ||
{ | ||
"category": "fiction", | ||
"author": "J. R. R. Tolkien", | ||
"title": "The Lord of the Rings", | ||
"isbn": "0-395-19395-8", | ||
"price": 22.99 | ||
} | ||
], | ||
"bicycle": { | ||
"color": "red", | ||
"price": 19.95 | ||
} | ||
{ | ||
"store": { | ||
"book": [ | ||
{ | ||
"category": "reference", | ||
"author": "Nigel Rees", | ||
"title": "Sayings of the Century", | ||
"price": 8.95 | ||
}, | ||
{ | ||
"category": "fiction", | ||
"author": "Evelyn Waugh", | ||
"title": "Sword of Honour", | ||
"price": 12.99 | ||
}, | ||
{ | ||
"category": "fiction", | ||
"author": "Herman Melville", | ||
"title": "Moby Dick", | ||
"isbn": "0-553-21311-3", | ||
"price": 8.99 | ||
}, | ||
{ | ||
"category": "fiction", | ||
"author": "J. R. R. Tolkien", | ||
"title": "The Lord of the Rings", | ||
"isbn": "0-395-19395-8", | ||
"price": 22.99 | ||
} | ||
], | ||
"bicycle": { | ||
"color": "red", | ||
"price": 19.95 | ||
} | ||
} | ||
} | ||
``` | ||
@@ -198,0 +208,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
166017
16
1568
316
14
2
5
6