UNPKG

@zkochan/pnpm

Version:

Fast, disk space efficient package manager

102 lines (101 loc) 5.08 kB
{ "_args": [ [ { "raw": "err-code@^1.0.0", "scope": null, "escapedName": "err-code", "name": "err-code", "rawSpec": "^1.0.0", "spec": ">=1.0.0 <2.0.0", "type": "range" }, "/home/zkochan/src/pnpm/packages/pnpm/node_modules/promise-retry" ] ], "_from": "err-code@>=1.0.0 <2.0.0", "_id": "err-code@1.1.2", "_inCache": true, "_location": "/err-code", "_nodeVersion": "6.10.1", "_npmOperationalInternal": { "host": "packages-18-east.internal.npmjs.com", "tmp": "tmp/err-code-1.1.2.tgz_1491258166209_0.5635493844747543" }, "_npmUser": { "name": "satazor", "email": "andremiguelcruz@msn.com" }, "_npmVersion": "3.10.10", "_phantomChildren": {}, "_requested": { "raw": "err-code@^1.0.0", "scope": null, "escapedName": "err-code", "name": "err-code", "rawSpec": "^1.0.0", "spec": ">=1.0.0 <2.0.0", "type": "range" }, "_requiredBy": [ "/promise-retry" ], "_resolved": "https://registry.npmjs.org/err-code/-/err-code-1.1.2.tgz", "_shasum": "06e0116d3028f6aef4806849eb0ea6a748ae6960", "_shrinkwrap": null, "_spec": "err-code@^1.0.0", "_where": "/home/zkochan/src/pnpm/packages/pnpm/node_modules/promise-retry", "author": { "name": "IndigoUnited", "email": "hello@indigounited.com", "url": "http://indigounited.com" }, "bugs": { "url": "https://github.com/IndigoUnited/js-err-code/issues/" }, "dependencies": {}, "description": "Create an error with a code", "devDependencies": { "@satazor/eslint-config": "^3.0.0", "browserify": "^14.0.0", "eslint": "^3.0.0", "expect.js": "^0.3.1", "mocha": "^3.0.2" }, "directories": {}, "dist": { "shasum": "06e0116d3028f6aef4806849eb0ea6a748ae6960", "tarball": "https://registry.npmjs.org/err-code/-/err-code-1.1.2.tgz" }, "gitHead": "af1a79e272c10e4daf38d75a3e91c85783b226a4", "homepage": "https://github.com/IndigoUnited/js-err-code#readme", "keywords": [ "error", "err", "code", "properties", "property" ], "license": "MIT", "main": "index.js", "maintainers": [ { "name": "satazor", "email": "andremiguelcruz@msn.com" } ], "name": "err-code", "optionalDependencies": {}, "readme": "# err-code\n\n[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency status][david-dm-image]][david-dm-url] [![Dev Dependency status][david-dm-dev-image]][david-dm-dev-url]\n\n[npm-url]:https://npmjs.org/package/err-code\n[downloads-image]:http://img.shields.io/npm/dm/err-code.svg\n[npm-image]:http://img.shields.io/npm/v/err-code.svg\n[travis-url]:https://travis-ci.org/IndigoUnited/js-err-code\n[travis-image]:http://img.shields.io/travis/IndigoUnited/js-err-code/master.svg\n[david-dm-url]:https://david-dm.org/IndigoUnited/js-err-code\n[david-dm-image]:https://img.shields.io/david/IndigoUnited/js-err-code.svg\n[david-dm-dev-url]:https://david-dm.org/IndigoUnited/js-err-code#info=devDependencies\n[david-dm-dev-image]:https://img.shields.io/david/dev/IndigoUnited/js-err-code.svg\n\nCreate new error instances with a code and additional properties.\n\n\n## Installation\n\n`$ npm install err-code` - `NPM` \n`$ bower install err-code` - `bower`\n\nThe browser file is named index.umd.js which supports CommonJS, AMD and globals (errCode).\n\n\n## Why\n\nI find myself doing this repeatedly:\n\n```js\nvar err = new Error('My message');\nerr.code = 'SOMECODE';\nerr.detail = 'Additional information about the error';\nthrow err;\n```\n\n\n## Usage\n\nSimple usage.\n\n```js\nvar errcode = require('err-code');\n\n// fill error with message + code\nthrow errcode(new Error('My message'), 'ESOMECODE');\n// fill error with message + code + props\nthrow errcode(new Error('My message'), 'ESOMECODE', { detail: 'Additional information about the error' });\n// fill error with message + props\nthrow errcode(new Error('My message'), { detail: 'Additional information about the error' });\n\n\n// You may also pass a string in the first argument and an error will be automatically created\n// for you, though the stack trace will contain err-code in it.\n\n// create error with message + code\nthrow errcode('My message', 'ESOMECODE');\n// create error with message + code + props\nthrow errcode('My message', 'ESOMECODE', { detail: 'Additional information about the error' });\n// create error with message + props\nthrow errcode('My message', { detail: 'Additional information about the error' });\n```\n\n\n## Tests\n\n`$ npm test`\n\n\n## License\n\nReleased under the [MIT License](http://www.opensource.org/licenses/mit-license.php).\n", "readmeFilename": "README.md", "repository": { "type": "git", "url": "git://github.com/IndigoUnited/js-err-code.git" }, "scripts": { "browserify": "browserify -s err-code index.js > index.umd.js", "lint": "eslint '{*.js,test/**/*.js}' --ignore-pattern *.umd.js", "test": "mocha --bail" }, "version": "1.1.2" }