-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.json
44 lines (44 loc) · 1.9 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
{
"name": "defined",
"version": "0.0.0",
"description": "return the first argument that is `!== undefined`",
"main": "index.js",
"directories": {
"example": "example",
"test": "test"
},
"dependencies": {},
"devDependencies": {
"tap": "~0.3.0",
"tape": "~0.0.2"
},
"scripts": {
"test": "tap test/*.js"
},
"repository": {
"type": "git",
"url": "git://github.com/substack/defined.git"
},
"homepage": "https://github.com/substack/defined",
"keywords": [
"undefined",
"short-circuit",
"||",
"or",
"//",
"defined-or"
],
"author": {
"name": "James Halliday",
"email": "mail@substack.net",
"url": "http://substack.net"
},
"license": "MIT",
"readme": "# defined\n\nreturn the first argument that is `!== undefined`\n\n[![build status](https://secure.travis-ci.org/substack/defined.png)](http://travis-ci.org/substack/defined)\n\nMost of the time when I chain together `||`s, I actually just want the first\nitem that is not `undefined`, not the first non-falsy item.\n\nThis module is like the defined-or (`//`) operator in perl 5.10+.\n\n# example\n\n``` js\nvar defined = require('defined');\nvar opts = { y : false, w : 4 };\nvar x = defined(opts.x, opts.y, opts.w, 100);\nconsole.log(x);\n```\n\n```\n$ node example/defined.js\nfalse\n```\n\nThe return value is `false` because `false` is the first item that is\n`!== undefined`.\n\n# methods\n\n``` js\nvar defined = require('defined')\n```\n\n## var x = defined(a, b, c...)\n\nReturn the first item in the argument list `a, b, c...` that is `!== undefined`.\n\nIf all the items are `=== undefined`, return undefined.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install defined\n```\n\n# license\n\nMIT\n",
"readmeFilename": "readme.markdown",
"bugs": {
"url": "https://github.com/substack/defined/issues"
},
"_id": "defined@0.0.0",
"_from": "defined@~0.0.0"
}