-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.json
52 lines (52 loc) · 2.71 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{
"name": "create-error",
"version": "0.3.1",
"description": "Simple helper for sub-classing the Error object",
"main": "create-error.js",
"scripts": {
"test": "mocha -R spec test/index.js"
},
"directories": {
"test": "test"
},
"repository": {
"type": "git",
"url": "https://github.com/tgriesser/create-error.git"
},
"keywords": [
"errors"
],
"author": {
"name": "Tim Griesser",
"url": "https://github.com/tgriesser"
},
"license": "MIT",
"devDependencies": {
"mocha": "~1.15.0"
},
"readme": "create-error.js\n===============\n\nA simple helper for creating subclassed errors in Javascript.\n\n[![Build Status](https://travis-ci.org/tgriesser/create-error.png)](https://travis-ci.org/tgriesser/create-error)\n\n## Use:\n\n```bash\n$ npm install create-error\n$ bower install create-error\n```\n\n```js\nvar createError = require('create-error');\n\nvar MyCustomError = createError('MyCustomError');\nvar SubCustomError = createError(MyCustomError, 'CoolSubError', {messages: []});\n\nvar sub = new SubCustomError('My Message', {someVal: 'value'});\n\nsub instanceof SubCustomError // true\nsub instanceof MyCustomError // true\nsub instanceof Error // true\n\nassert.deepEqual(sub.messages, []) // true\nassert.equal(sub.someVal, 'value') // true\n```\n\n### createError(name, [properties])\n\nCreates a new error by specifying the name of the error to be created,\ntaking an optional hash of properties to be attached to the error class\nupon creation.\n\n### createError(Target, [name, [properties]])\n\nCreate a new error by specifying the `Target` error class we wish to inherit from,\nalong with an optional name and properties for the error. If the `name` is omitted,\nit will have the same name as the parent error.\n\n### Additional Notes:\n\nIn the browser, the function will be assigned to `window.createError`,\nand `createError.noConflict()` will restore the original `window.createError`\nif overwritten.\n\n### License\n\nMIT\n",
"readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/tgriesser/create-error/issues"
},
"_id": "create-error@0.3.1",
"dist": {
"shasum": "69810245a629e654432bf04377360003a5351a23",
"tarball": "http://registry.npmjs.org/create-error/-/create-error-0.3.1.tgz"
},
"_from": "create-error@>=0.3.1 <0.4.0",
"_npmVersion": "1.3.2",
"_npmUser": {
"name": "tgriesser",
"email": "tgriesser10@gmail.com"
},
"maintainers": [
{
"name": "tgriesser",
"email": "tgriesser10@gmail.com"
}
],
"_shasum": "69810245a629e654432bf04377360003a5351a23",
"_resolved": "https://registry.npmjs.org/create-error/-/create-error-0.3.1.tgz",
"homepage": "https://github.com/tgriesser/create-error"
}