{"_id":"falsey","_rev":"81528","name":"falsey","description":"Returns true if the given is falsey (according to JavaScript) or matches a 'falsey' keyword.","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"time":{"modified":"2021-06-03T10:26:01.000Z","created":"2014-07-09T00:44:23.654Z","1.0.0":"2018-03-19T01:55:47.429Z","0.3.2":"2017-09-11T19:23:16.307Z","0.3.1":"2017-09-11T19:12:11.859Z","0.3.0":"2015-12-20T10:33:44.378Z","0.2.1":"2015-03-08T04:19:47.145Z","0.2.0":"2015-03-08T04:18:07.148Z","0.1.0":"2014-07-09T00:44:23.654Z"},"users":{},"author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/falsey.git"},"versions":{"1.0.0":{"name":"falsey","description":"Returns true if the given is falsey (according to JavaScript) or matches a 'falsey' keyword.","version":"1.0.0","homepage":"https://github.com/jonschlinkert/falsey","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/falsey.git"},"bugs":{"url":"https://github.com/jonschlinkert/falsey/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=4"},"scripts":{"test":"mocha"},"devDependencies":{"gulp-format-md":"^1.0.0","mocha":"^3.5.3"},"keywords":["args","arguments","array","boolean","check","false","falsey","null","object","type","undefined","value"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["is-number","is-primitive","isobject","kind-of"]},"lint":{"reflinks":true}},"gitHead":"4398cbc233d219021d45ee48f46ed50f93ddcf44","_id":"falsey@1.0.0","_npmVersion":"5.7.1","_nodeVersion":"9.7.1","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"dist":{"shasum":"71bdd775c24edad9f2f5c015ce8be24400bb5d7d","size":3397,"noattachment":false,"key":"/falsey/-/falsey-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/falsey/download/falsey-1.0.0.tgz"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/falsey_1.0.0_1521424547370_0.29125662258718643"},"_hasShrinkwrap":false,"publish_time":1521424547429,"_cnpm_publish_time":1521424547429},"0.3.2":{"name":"falsey","description":"Returns true if `value` is falsey. Works for strings, arrays and `arguments` objects with a length of `0`, and objects with no own enumerable properties are considered falsey.","version":"0.3.2","homepage":"https://github.com/jonschlinkert/falsey","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/falsey.git"},"bugs":{"url":"https://github.com/jonschlinkert/falsey/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"kind-of":"^5.0.2"},"devDependencies":{"gulp-format-md":"^1.0.0","mocha":"*"},"keywords":["args","arguments","array","boolean","check","false","falsey","null","object","type","undefined","value"],"verb":{"related":{"list":["is-number","is-primitive","isobject","kind-of"]},"plugins":["gulp-format-md"],"toc":false,"layout":"default","tasks":["readme"],"lint":{"reflinks":true}},"gitHead":"ce7a1f44d305651636fe68aab62120cef8ec2c91","_id":"falsey@0.3.2","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"doowb","email":"brian.woodward@gmail.com"},"dist":{"shasum":"b21c90c5c34660fc192bf909575db95b6880d597","size":3142,"noattachment":false,"key":"/falsey/-/falsey-0.3.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/falsey/download/falsey-0.3.2.tgz"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/falsey-0.3.2.tgz_1505157795847_0.7937949514016509"},"directories":{},"publish_time":1505157796307,"_hasShrinkwrap":false,"_cnpm_publish_time":1505157796307},"0.3.1":{"name":"falsey","description":"Returns true if `value` is falsey. Works for strings, arrays and `arguments` objects with a length of `0`, and objects with no own enumerable properties are considered falsey.","version":"0.3.1","homepage":"https://github.com/jonschlinkert/falsey","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/falsey.git"},"bugs":{"url":"https://github.com/jonschlinkert/falsey/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"kind-of":"^5.0.2"},"devDependencies":{"gulp-format-md":"^1.0.0","mocha":"*"},"keywords":["args","arguments","array","boolean","check","false","falsey","null","object","type","undefined","value"],"verb":{"related":{"list":["is-number","is-primitive","isobject","kind-of"]},"plugins":["gulp-format-md"],"toc":false,"layout":"default","tasks":["readme"],"lint":{"reflinks":true}},"gitHead":"6c0c31ad27f5bcc9fd96b7318a455a415acddf37","_id":"falsey@0.3.1","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"doowb","email":"brian.woodward@gmail.com"},"dist":{"shasum":"e42aedea723337f11cf64571f3d946903004196f","size":3057,"noattachment":false,"key":"/falsey/-/falsey-0.3.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/falsey/download/falsey-0.3.1.tgz"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/falsey-0.3.1.tgz_1505157131729_0.06737862201407552"},"directories":{},"publish_time":1505157131859,"_cnpm_publish_time":1505157131859,"_hasShrinkwrap":false},"0.3.0":{"name":"falsey","description":"Returns true if `value` is falsey. Works for strings, arrays and `arguments` objects with a length of `0`, and objects with no own enumerable properties are considered falsey.","version":"0.3.0","homepage":"https://github.com/jonschlinkert/falsey","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/falsey.git"},"bugs":{"url":"https://github.com/jonschlinkert/falsey/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"kind-of":"^3.0.2"},"devDependencies":{"mocha":"*"},"keywords":["args","arguments","array","boolean","check","false","falsey","null","object","type","undefined","value"],"verb":{"related":{"list":["is-number","is-primitive","isobject","kind-of"]},"plugins":["gulp-format-md"]},"gitHead":"8288e3483b460a812e55f34a351e4e94f5ff2f9d","_id":"falsey@0.3.0","_shasum":"da9f9d87542f9a527f83d8c7616b9d0a959f4ef8","_from":".","_npmVersion":"3.3.6","_nodeVersion":"5.0.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"da9f9d87542f9a527f83d8c7616b9d0a959f4ef8","size":2636,"noattachment":false,"key":"/falsey/-/falsey-0.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/falsey/download/falsey-0.3.0.tgz"},"directories":{},"publish_time":1450607624378,"_cnpm_publish_time":1450607624378,"_hasShrinkwrap":false},"0.2.1":{"name":"falsey","description":"Returns true if `value` is falsey. Works for strings, arrays and `arguments` objects with a length of `0`, and objects with no own enumerable properties are considered falsey.","version":"0.2.1","homepage":"https://github.com/jonschlinkert/falsey","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/falsey.git"},"bugs":{"url":"https://github.com/jonschlinkert/falsey/issues"},"license":{"type":"MIT","url":"https://github.com/jonschlinkert/falsey/blob/master/LICENSE"},"files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"kind-of":"^1.1.0"},"devDependencies":{"mocha":"*"},"keywords":["falsey","false","boolean","null","type","check","value","array","object","arguments","args","undefined"],"gitHead":"85529c71a009b37090ac55ee9c5cf2fed8d72212","_id":"falsey@0.2.1","_shasum":"5efbce280cd1b6d42f9055e5301053ad682439b4","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"5efbce280cd1b6d42f9055e5301053ad682439b4","size":2489,"noattachment":false,"key":"/falsey/-/falsey-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/falsey/download/falsey-0.2.1.tgz"},"directories":{},"publish_time":1425788387145,"_cnpm_publish_time":1425788387145,"_hasShrinkwrap":false},"0.2.0":{"name":"falsey","description":"Returns true if `value` is falsey. Works for strings, arrays and `arguments` objects with a length of `0`, and objects with no own enumerable properties are considered falsey.","version":"0.2.0","homepage":"https://github.com/jonschlinkert/falsey","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/falsey.git"},"bugs":{"url":"https://github.com/jonschlinkert/falsey/issues"},"license":{"type":"MIT","url":"https://github.com/jonschlinkert/falsey/blob/master/LICENSE"},"files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"kind-of":"^1.1.0"},"devDependencies":{"mocha":"*"},"keywords":["falsey","false","boolean","null","type","check","value","array","object","arguments","args","undefined"],"gitHead":"a2f4df74f0e3c052d6ab6878953042120c5a512c","_id":"falsey@0.2.0","_shasum":"c2e98891a89392457c791fd625ac323c6b83c56b","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"c2e98891a89392457c791fd625ac323c6b83c56b","size":2490,"noattachment":false,"key":"/falsey/-/falsey-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/falsey/download/falsey-0.2.0.tgz"},"directories":{},"publish_time":1425788287148,"_cnpm_publish_time":1425788287148,"_hasShrinkwrap":false},"0.1.0":{"name":"falsey","description":"Returns true if `value` is falsey. Strings, arrays and `arguments` objects with a length of `0`, and objects with no own enumerable properties are considered falsey.","version":"0.1.0","homepage":"https://github.com/jonschlinkert/falsey","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/falsey.git"},"bugs":{"url":"https://github.com/jonschlinkert/falsey/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/falsey/blob/master/LICENSE-MIT"}],"keywords":["falsey","false","boolean","null","type","check","value","array","object","arguments","args","undefined"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha -R spec"},"devDependencies":{"verb":">= 0.2.6","mocha":"*"},"_id":"falsey@0.1.0","_shasum":"59932e9ce62b19ca5845db5a57b03436ebd9c3bb","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"59932e9ce62b19ca5845db5a57b03436ebd9c3bb","size":3574,"noattachment":false,"key":"/falsey/-/falsey-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/falsey/download/falsey-0.1.0.tgz"},"directories":{},"publish_time":1404866663654,"_cnpm_publish_time":1404866663654,"_hasShrinkwrap":false}},"readme":"# falsey [![NPM version](https://img.shields.io/npm/v/falsey.svg?style=flat)](https://www.npmjs.com/package/falsey) [![NPM monthly downloads](https://img.shields.io/npm/dm/falsey.svg?style=flat)](https://npmjs.org/package/falsey) [![NPM total downloads](https://img.shields.io/npm/dt/falsey.svg?style=flat)](https://npmjs.org/package/falsey) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/falsey.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/falsey) [![Windows Build Status](https://img.shields.io/appveyor/ci/jonschlinkert/falsey.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/jonschlinkert/falsey)\n\n> Returns true if the given is falsey (according to JavaScript) or matches a 'falsey' keyword.\n\nPlease consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save falsey\n```\n\n## What is this?\n\nThis is intended to be a fun way of accepting alternatives to `false` or \"no\" in CLI prompts, web forms, etc. For example, you might want to allow users to define `nil` or `nope` to disable something.\n\n## Usage\n\n```js\nconst falsey = require('falsey');\n\nconsole.log(falsey());       //=> true\nconsole.log(falsey(false));  //=> true\nconsole.log(falsey('nil'));  //=> true\nconsole.log(falsey('nope')); //=> true\nconsole.log(falsey('yes'));  //=> false\n```\n\n## Examples\n\nAny value that is not falsey (according to JavaScript) _and is not in the list_ of [falsey keywords](#falsey-keywords) will return `false`:\n\n```js\nfalsey('abc');\nfalsey(true);\nfalsey(1);\nfalsey('1');\nfalsey({});\nfalsey([]);\n```\n\nAny value that is falsey (according to JavaScript) _or is in the list_ of [falsey keywords](#falsey-keywords) will return `true`:\n\n```js\nfalsey();          //=> true\nfalsey('');        //=> true\nfalsey(0);         //=> true\nfalsey(false);     //=> true\nfalsey(NaN);       //=> true\nfalsey(null);      //=> true\nfalsey(undefined); //=> true\nfalsey(void 0);    //=> true\n```\n\n### Falsey keywords\n\nIf a value matches one of the built-in \"falsey\" keywords (all strings) it will return `true`:\n\n* `0`\n* `false`\n* `nada`\n* `nil`\n* `nay`\n* `nah`\n* `negative`\n* `no`\n* `none`\n* `nope`\n* `nul`\n* `null`\n* `nix`\n* `nyet`\n* `uh-uh`\n* `veto`\n* `zero`\n\n**Customize falsey keywords**\n\nPass an array of custom keywords that should return `true` when evaluated as _falsey_:\n\n```js\nfalsey('zilch', ['no', 'nope', 'nada', 'zilch']); //=> true\n```\n\nDisable built-in keywords by passing an empty array:\n\n```js\nfalsey('nil', []); //=> false\n```\n\n**Extend built-in keywords**\n\nBuilt-in keywords are exposed on the `.keywords` property so that you may extend them with your own keywords:\n\n```js\nfalsey('zilch', falsey.keywords.concat(['zilch'])); //=> true\n```\n\n## Release history\n\n### v1.0\n\n**Breaking changes**\n\n* objects will now always returns `false`\n* more words were added to the built-in list of [falsey keywords](#falsey-keywords)\n\n## About\n\n<details>\n<summary><strong>Contributing</strong></summary>\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n</details>\n\n<details>\n<summary><strong>Running Tests</strong></summary>\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install && npm test\n```\n\n</details>\n\n<details>\n<summary><strong>Building docs</strong></summary>\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme && verb\n```\n\n</details>\n\n### Related projects\n\nYou might also be interested in these projects:\n\n* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number \"Returns true if the value is a number. comprehensive tests.\")\n* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive.  | [homepage](https://github.com/jonschlinkert/is-primitive \"Returns `true` if the value is a primitive. \")\n* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject \"Returns true if the value is an object and not an array or null.\")\n* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of \"Get the native type of a value.\")\n\n### Contributors\n\n| **Commits** | **Contributor** | \n| --- | --- |\n| 12 | [jonschlinkert](https://github.com/jonschlinkert) |\n| 9 | [doowb](https://github.com/doowb) |\n| 3 | [jesstelford](https://github.com/jesstelford) |\n\n### Author\n\n**Jon Schlinkert**\n\n* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)\n* [GitHub Profile](https://github.com/jonschlinkert)\n* [Twitter Profile](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on March 18, 2018._","_attachments":{},"homepage":"https://github.com/jonschlinkert/falsey","bugs":{"url":"https://github.com/jonschlinkert/falsey/issues"},"license":"MIT"}