{ "_id": "own-or-env", "_rev": "2-df007eddf7bd6cfc76179be2b8e0c528", "name": "own-or-env", "description": "Use an objects own property, or an environment variable. Optionally treat as a boolean if the env should be set to 1 or 0.", "dist-tags": { "latest": "1.0.1" }, "versions": { "1.0.0": { "name": "own-or-env", "version": "1.0.0", "description": "Use an objects own property, or an environment variable. Optionally treat as a boolean if the env should be set to 1 or 0.", "main": "own-or-env.js", "scripts": { "test": "node test.js" }, "repository": { "type": "git", "url": "git+https://github.com/isaacs/own-or-env.git" }, "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", "url": "http://blog.izs.me/" }, "license": "ISC", "bugs": { "url": "https://github.com/isaacs/own-or-env/issues" }, "homepage": "https://github.com/isaacs/own-or-env#readme", "gitHead": "fdd6fdcda24ad7b8dbf2e9363e7d38e81061df07", "_id": "own-or-env@1.0.0", "_shasum": "9ef920fc81e2e63cf59d41101258368cf4fca4fb", "_from": ".", "_npmVersion": "3.10.10", "_nodeVersion": "6.9.4", "_npmUser": { "name": "isaacs", "email": "i@izs.me" }, "dist": { "shasum": "9ef920fc81e2e63cf59d41101258368cf4fca4fb", "tarball": "https://registry.npmjs.org/own-or-env/-/own-or-env-1.0.0.tgz" }, "maintainers": [ { "name": "isaacs", "email": "i@izs.me" } ], "_npmOperationalInternal": { "host": "packages-18-east.internal.npmjs.com", "tmp": "tmp/own-or-env-1.0.0.tgz_1484784248444_0.6228025830350816" }, "directories": {} }, "1.0.1": { "name": "own-or-env", "version": "1.0.1", "description": "Use an objects own property, or an environment variable. Optionally treat as a boolean if the env should be set to 1 or 0.", "main": "own-or-env.js", "scripts": { "test": "tap test.js --100", "preversion": "npm test", "postversion": "npm publish", "postpublish": "git push origin --all; git push origin --tags" }, "repository": { "type": "git", "url": "git+https://github.com/isaacs/own-or-env.git" }, "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", "url": "http://blog.izs.me/" }, "license": "ISC", "bugs": { "url": "https://github.com/isaacs/own-or-env/issues" }, "homepage": "https://github.com/isaacs/own-or-env#readme", "dependencies": { "own-or": "^1.0.0" }, "devDependencies": { "tap": "^11.1.0" }, "gitHead": "31d69cd54ae14e5d605696bc58a77091d78b37ac", "_id": "own-or-env@1.0.1", "_npmVersion": "5.6.0-canary.11", "_nodeVersion": "8.9.1", "_npmUser": { "name": "isaacs", "email": "i@izs.me" }, "dist": { "integrity": "sha512-y8qULRbRAlL6x2+M0vIe7jJbJx/kmUTzYonRAa2ayesR2qWLswninkVyeJe4x3IEXhdgoNodzjQRKAoEs6Fmrw==", "shasum": "54ce601d3bf78236c5c65633aa1c8ec03f8007e4", "tarball": "https://registry.npmjs.org/own-or-env/-/own-or-env-1.0.1.tgz", "fileCount": 8, "unpackedSize": 4908 }, "maintainers": [ { "name": "isaacs", "email": "i@izs.me" } ], "directories": {}, "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/own-or-env_1.0.1_1518458023062_0.3464231901305035" } } }, "readme": "# own-or-env\n\nUse an objects own property, or an environment variable. Optionally\ntreat as a boolean if the env should be set to 1 or 0.\n\n## API\n\n`ownOrEnv(object, field, env, boolean)`\n\nUse the `object[field]` if it's an own property, otherwise use the\nnamed environent variable. If `boolean` is set to `true`, then cast\nto a boolean flag.\n\n## USAGE\n\n```js\n// will set doTheThing to true based on config.doThing, falling back\n// to reading process.env.DO_THING, where '0' is treated as false.\nvar doTheThing = ownOrEnv(config, 'doThing', 'DO_THING', true)\n\n// just treat this one as a string, not a boolean flag\nvar file = ownOrEnv(config, 'file', 'MY_FILE')\n```\n", "maintainers": [ { "name": "isaacs", "email": "i@izs.me" } ], "time": { "modified": "2018-02-12T17:53:44.723Z", "created": "2017-01-19T00:04:10.288Z", "1.0.0": "2017-01-19T00:04:10.288Z", "1.0.1": "2018-02-12T17:53:43.108Z" }, "homepage": "https://github.com/isaacs/own-or-env#readme", "repository": { "type": "git", "url": "git+https://github.com/isaacs/own-or-env.git" }, "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", "url": "http://blog.izs.me/" }, "bugs": { "url": "https://github.com/isaacs/own-or-env/issues" }, "license": "ISC", "readmeFilename": "README.md", "_attachments": {} }