UNPKG

@zkochan/pnpm

Version:

Fast, disk space efficient package manager

113 lines (112 loc) 4.07 kB
{ "_args": [ [ { "raw": "parse-json@^4.0.0", "scope": null, "escapedName": "parse-json", "name": "parse-json", "rawSpec": "^4.0.0", "spec": ">=4.0.0 <5.0.0", "type": "range" }, "/home/zkochan/src/pnpm/packages/pnpm/node_modules/load-json-file" ] ], "_from": "parse-json@>=4.0.0 <5.0.0", "_id": "parse-json@4.0.0", "_inCache": true, "_location": "/parse-json", "_nodeVersion": "4.8.4", "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/parse-json-4.0.0.tgz_1509782029937_0.44315575854852796" }, "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, "_npmVersion": "2.15.11", "_phantomChildren": {}, "_requested": { "raw": "parse-json@^4.0.0", "scope": null, "escapedName": "parse-json", "name": "parse-json", "rawSpec": "^4.0.0", "spec": ">=4.0.0 <5.0.0", "type": "range" }, "_requiredBy": [ "/find-packages/load-json-file", "/load-json-file" ], "_resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", "_shasum": "be35f5425be1f7f6c747184f98a788cb99477ee0", "_shrinkwrap": null, "_spec": "parse-json@^4.0.0", "_where": "/home/zkochan/src/pnpm/packages/pnpm/node_modules/load-json-file", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "bugs": { "url": "https://github.com/sindresorhus/parse-json/issues" }, "dependencies": { "error-ex": "^1.3.1", "json-parse-better-errors": "^1.0.1" }, "description": "Parse JSON with more helpful errors", "devDependencies": { "ava": "*", "nyc": "^11.2.1", "xo": "*" }, "directories": {}, "dist": { "shasum": "be35f5425be1f7f6c747184f98a788cb99477ee0", "tarball": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz" }, "engines": { "node": ">=4" }, "files": [ "index.js", "vendor" ], "gitHead": "d1f4edbbef6e76ddc084b2f88e4d64a2b08081c5", "homepage": "https://github.com/sindresorhus/parse-json#readme", "keywords": [ "parse", "json", "graceful", "error", "message", "humanize", "friendly", "helpful", "string", "str" ], "license": "MIT", "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], "name": "parse-json", "optionalDependencies": {}, "readme": "# parse-json [![Build Status](https://travis-ci.org/sindresorhus/parse-json.svg?branch=master)](https://travis-ci.org/sindresorhus/parse-json)\n\n> Parse JSON with more helpful errors\n\n\n## Install\n\n```\n$ npm install parse-json\n```\n\n\n## Usage\n\n```js\nconst parseJson = require('parse-json');\nconst json = '{\\n\\t\"foo\": true,\\n}';\n\n\nJSON.parse(json);\n/*\nundefined:3\n}\n^\nSyntaxError: Unexpected token }\n*/\n\n\nparseJson(json);\n/*\nJSONError: Trailing comma in object at 3:1\n}\n^\n*/\n\n\nparseJson(json, 'foo.json');\n/*\nJSONError: Trailing comma in object in foo.json:3:1\n}\n^\n*/\n\n\n// You can also add the filename at a later point\ntry {\n\tparseJson(json);\n} catch (err) {\n\terr.fileName = 'foo.json';\n\tthrow err;\n}\n/*\nJSONError: Trailing comma in object in foo.json:3:1\n}\n^\n*/\n```\n\n## API\n\n### parseJson(input, [reviver], [filename])\n\n#### input\n\nType: `string`\n\n#### reviver\n\nType: `Function`\n\nPrescribes how the value originally produced by parsing is transformed, before being returned. See [`JSON.parse` docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Using_the_reviver_parameter\n) for more.\n\n#### filename\n\nType: `string`\n\nFilename displayed in the error message.\n\n\n## License\n\nMIT © [Sindre Sorhus](https://sindresorhus.com)\n", "readmeFilename": "readme.md", "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/parse-json.git" }, "scripts": { "test": "xo && nyc ava" }, "version": "4.0.0" }