{"_id":"yn","_rev":"231713","name":"yn","description":"Parse yes/no like values","dist-tags":{"latest":"5.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2023-03-24T15:40:08.000Z","created":"2014-08-06T23:45:19.192Z","5.0.0":"2021-08-14T20:48:04.596Z","4.0.0":"2019-12-01T09:16:26.919Z","3.1.1":"2019-07-30T18:20:04.773Z","3.1.0":"2019-04-06T11:56:24.350Z","3.0.0":"2018-12-08T20:14:17.355Z","2.0.0":"2017-05-12T20:04:04.605Z","1.3.0":"2017-05-08T17:46:35.993Z","1.2.0":"2015-09-15T15:21:06.561Z","1.1.0":"2014-10-10T09:58:31.491Z","1.0.0":"2014-08-06T23:45:19.192Z"},"users":{},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/yn.git"},"versions":{"5.0.0":{"name":"yn","version":"5.0.0","description":"Parse yes/no like values","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/yn.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["yn","yes","no","cli","prompt","validate","input","answer","true","false","parse","lenient"],"devDependencies":{"ava":"^3.15.0","tsd":"^0.17.0","xo":"^0.44.0"},"gitHead":"7e4dcd22353f84d38a3d227a1424c035f5a4756f","bugs":{"url":"https://github.com/sindresorhus/yn/issues"},"homepage":"https://github.com/sindresorhus/yn#readme","_id":"yn@5.0.0","_nodeVersion":"12.22.1","_npmVersion":"7.10.0","dist":{"shasum":"63fc2e2e0056cf294397eed6ad4a3fbdf707f26f","size":2590,"noattachment":false,"key":"/yn/-/yn-5.0.0.tgz","tarball":"http://name.csiicloud.com:7001/yn/download/yn-5.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/yn_5.0.0_1628974084458_0.5464042594338365"},"_hasShrinkwrap":false,"publish_time":1628974084596,"_cnpm_publish_time":1628974084596,"_cnpmcore_publish_time":"2021-12-14T06:22:14.460Z"},"4.0.0":{"name":"yn","version":"4.0.0","description":"Parse yes/no like values","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/yn.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=10"},"scripts":{"test":"xo && ava && tsd"},"keywords":["yn","yes","no","cli","prompt","validate","input","answer","true","false","parse","lenient"],"devDependencies":{"ava":"^2.4.0","tsd":"^0.11.0","xo":"^0.25.3"},"gitHead":"028ca5df4818a6fc519bd349686619218f5c3312","bugs":{"url":"https://github.com/sindresorhus/yn/issues"},"homepage":"https://github.com/sindresorhus/yn#readme","_id":"yn@4.0.0","_nodeVersion":"10.17.0","_npmVersion":"6.11.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"611480051ea43b510da1dfdbe177ed159f00a979","size":2590,"noattachment":false,"key":"/yn/-/yn-4.0.0.tgz","tarball":"http://name.csiicloud.com:7001/yn/download/yn-4.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/yn_4.0.0_1575191786776_0.7972353847491238"},"_hasShrinkwrap":false,"publish_time":1575191786919,"_cnpm_publish_time":1575191786919,"_cnpmcore_publish_time":"2021-12-14T06:22:14.703Z"},"3.1.1":{"name":"yn","version":"3.1.1","description":"Parse yes/no like values","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/yn.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava && tsd"},"keywords":["yn","yes","no","cli","prompt","validate","input","answer","true","false","parse","lenient"],"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"322fa950779cc4db09b57b0543735b326b9e0c87","bugs":{"url":"https://github.com/sindresorhus/yn/issues"},"homepage":"https://github.com/sindresorhus/yn#readme","_id":"yn@3.1.1","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"1e87401a09d767c1d5eab26a6e4c185182d2eb50","size":2729,"noattachment":false,"key":"/yn/-/yn-3.1.1.tgz","tarball":"http://name.csiicloud.com:7001/yn/download/yn-3.1.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/yn_3.1.1_1564510804648_0.9811098729648924"},"_hasShrinkwrap":false,"publish_time":1564510804773,"_cnpm_publish_time":1564510804773,"_cnpmcore_publish_time":"2021-12-14T06:22:14.855Z"},"3.1.0":{"name":"yn","version":"3.1.0","description":"Parse yes/no like values","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/yn.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava && tsd"},"keywords":["yn","yes","no","cli","prompt","validate","input","answer","true","false","parse","lenient"],"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"1c5a2c081c6afcf543549165391caa0dafd36c96","bugs":{"url":"https://github.com/sindresorhus/yn/issues"},"homepage":"https://github.com/sindresorhus/yn#readme","_id":"yn@3.1.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"fcbe2db63610361afcc5eb9e0ac91e976d046114","size":2729,"noattachment":false,"key":"/yn/-/yn-3.1.0.tgz","tarball":"http://name.csiicloud.com:7001/yn/download/yn-3.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/yn_3.1.0_1554551784242_0.37789328455859006"},"_hasShrinkwrap":false,"publish_time":1554551784350,"_cnpm_publish_time":1554551784350,"_cnpmcore_publish_time":"2021-12-14T06:22:15.077Z"},"3.0.0":{"name":"yn","version":"3.0.0","description":"Parse yes/no like values","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/yn.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava && tsd-check"},"keywords":["yn","yes","no","cli","prompt","validate","input","answer","true","false","parse","lenient"],"devDependencies":{"ava":"^0.25.0","tsd-check":"^0.2.1","xo":"^0.23.0"},"gitHead":"723245e6b90ddd4ce575654192d0954f3a7040f0","bugs":{"url":"https://github.com/sindresorhus/yn/issues"},"homepage":"https://github.com/sindresorhus/yn#readme","_id":"yn@3.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"0073c6b56e92aed652fbdfd62431f2d6b9a7a091","size":2550,"noattachment":false,"key":"/yn/-/yn-3.0.0.tgz","tarball":"http://name.csiicloud.com:7001/yn/download/yn-3.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/yn_3.0.0_1544300057205_0.3769249069611098"},"_hasShrinkwrap":false,"publish_time":1544300057355,"_cnpm_publish_time":1544300057355,"_cnpmcore_publish_time":"2021-12-14T06:22:15.302Z"},"2.0.0":{"name":"yn","version":"2.0.0","description":"Parse yes/no like values","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/yn.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"contributors":[{"name":"Justin Woo","email":"moomoowoo@gmail.com"},{"name":"Mark Stosberg","email":"mark@rideamigos.com"}],"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js","lenient.js"],"keywords":["yn","yes","no","cli","prompt","validate","input","answer","true","false","parse","lenient"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"56e845e105950b4b3e4651c0370e5126b02dc9c2","bugs":{"url":"https://github.com/sindresorhus/yn/issues"},"homepage":"https://github.com/sindresorhus/yn#readme","_id":"yn@2.0.0","_shasum":"e5adabc8acf408f6385fc76495684c88e6af689a","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"e5adabc8acf408f6385fc76495684c88e6af689a","size":2423,"noattachment":false,"key":"/yn/-/yn-2.0.0.tgz","tarball":"http://name.csiicloud.com:7001/yn/download/yn-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/yn-2.0.0.tgz_1494619444361_0.5543094554450363"},"directories":{},"publish_time":1494619444605,"_hasShrinkwrap":false,"_cnpm_publish_time":1494619444605,"_cnpmcore_publish_time":"2021-12-14T06:22:15.476Z"},"1.3.0":{"name":"yn","version":"1.3.0","description":"Parse yes/no like values","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/yn.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"contributors":[{"name":"Justin Woo","email":"moomoowoo@gmail.com"},{"name":"Mark Stosberg","email":"mark@rideamigos.com"}],"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js","lenient.js"],"keywords":["yn","yes","no","cli","prompt","validate","input","answer","true","false","parse","lenient"],"devDependencies":{"ava":"^0.17.0","xo":"^0.16.0"},"dependencies":{"object-assign":"^4.1.1"},"gitHead":"ad2cf2fd3ed88245ca27fac3b3337a296e4e748f","bugs":{"url":"https://github.com/sindresorhus/yn/issues"},"homepage":"https://github.com/sindresorhus/yn#readme","_id":"yn@1.3.0","_shasum":"1b0812abb8d805d48966f8df385dc9dacc9a19d8","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.7.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"1b0812abb8d805d48966f8df385dc9dacc9a19d8","size":2437,"noattachment":false,"key":"/yn/-/yn-1.3.0.tgz","tarball":"http://name.csiicloud.com:7001/yn/download/yn-1.3.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/yn-1.3.0.tgz_1494265595762_0.31341670523397624"},"directories":{},"publish_time":1494265595993,"_hasShrinkwrap":false,"_cnpm_publish_time":1494265595993,"_cnpmcore_publish_time":"2021-12-14T06:22:15.708Z"},"1.2.0":{"name":"yn","version":"1.2.0","description":"Parse yes/no like values","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/yn.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"contributors":[{"name":"Justin Woo","email":"moomoowoo@gmail.com"},{"name":"Mark Stosberg","email":"mark@rideamigos.com"}],"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js","lenient.js"],"keywords":["yn","yes","no","cli","prompt","validate","input","answer","true","false","parse","lenient"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"c640cad3ab0eb9084a035068c31c639344324a80","bugs":{"url":"https://github.com/sindresorhus/yn/issues"},"homepage":"https://github.com/sindresorhus/yn#readme","_id":"yn@1.2.0","_shasum":"d237a4c533f279b2b89d3acac2db4b8c795e4a63","_from":".","_npmVersion":"2.14.2","_nodeVersion":"4.0.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"d237a4c533f279b2b89d3acac2db4b8c795e4a63","size":2162,"noattachment":false,"key":"/yn/-/yn-1.2.0.tgz","tarball":"http://name.csiicloud.com:7001/yn/download/yn-1.2.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1442330466561,"_hasShrinkwrap":false,"_cnpm_publish_time":1442330466561,"_cnpmcore_publish_time":"2021-12-14T06:22:15.934Z"},"1.1.0":{"name":"yn","version":"1.1.0","description":"Parse yes/no like values","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/yn"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"node test.js"},"files":["index.js","lenient.js"],"keywords":["yn","yes","no","cli","prompt","validate","input","answer","true","false","parse","lenient"],"devDependencies":{"ava":"0.0.4"},"gitHead":"3a24bebe671776a92e08d54bee2b4aeec6bec019","bugs":{"url":"https://github.com/sindresorhus/yn/issues"},"homepage":"https://github.com/sindresorhus/yn","_id":"yn@1.1.0","_shasum":"1eb23c230ddce3d7db988a0b687b3c151c2a8d3d","_from":".","_npmVersion":"2.1.2","_nodeVersion":"0.10.32","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"1eb23c230ddce3d7db988a0b687b3c151c2a8d3d","size":1417,"noattachment":false,"key":"/yn/-/yn-1.1.0.tgz","tarball":"http://name.csiicloud.com:7001/yn/download/yn-1.1.0.tgz"},"directories":{},"publish_time":1412935111491,"_hasShrinkwrap":false,"_cnpm_publish_time":1412935111491,"_cnpmcore_publish_time":"2021-12-14T06:22:16.166Z"},"1.0.0":{"name":"yn","version":"1.0.0","description":"Parse yes/no like values","license":"MIT","repository":{"type":"git","url":"git://github.com/sindresorhus/yn"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"node test.js"},"files":["index.js"],"keywords":["yn","yes","no","cli","prompt","validate","input","answer","true","false","parse"],"devDependencies":{"ava":"0.0.3"},"gitHead":"538882e720bd9188993da62f0dc9195f2ee73eb7","bugs":{"url":"https://github.com/sindresorhus/yn/issues"},"homepage":"https://github.com/sindresorhus/yn","_id":"yn@1.0.0","_shasum":"b3455cdf8392aa84d2f8c572098b17eb9514564a","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"b3455cdf8392aa84d2f8c572098b17eb9514564a","size":875,"noattachment":false,"key":"/yn/-/yn-1.0.0.tgz","tarball":"http://name.csiicloud.com:7001/yn/download/yn-1.0.0.tgz"},"directories":{},"publish_time":1407368719192,"_hasShrinkwrap":false,"_cnpm_publish_time":1407368719192,"_cnpmcore_publish_time":"2021-12-14T06:22:16.353Z"}},"readme":"# yn\n\n> Parse yes/no like values\n\nUseful for validating answers of a CLI prompt.\n\n---\n\nThe following case-insensitive values are recognized:\n\n```js\n'y', 'yes', 'true', true, '1', 1, 'n', 'no', 'false', false, '0', 0, 'on', 'off'\n```\n\n*Enable lenient mode to gracefully handle typos.*\n\n## Install\n\n```\n$ npm install yn\n```\n\n## Usage\n\n```js\nimport yn from 'yn';\n\nyn('y');\n//=> true\n\nyn('NO');\n//=> false\n\nyn(true);\n//=> true\n\nyn('abomasum');\n//=> undefined\n\nyn('abomasum', {default: false});\n//=> false\n\nyn('mo', {lenient: true});\n//=> false\n```\n\nUnrecognized values return `undefined`.\n\n## API\n\n### yn(input, options?)\n\n#### input\n\nType: `unknown`\n\nThe value that should be converted.\n\n#### options\n\nType: `object`\n\n##### lenient\n\nType: `boolean`\\\nDefault: `false`\n\nUse a key distance-based score to leniently accept typos of `yes` and `no`.\n\n##### default\n\nType: `boolean`\\\nDefault: `undefined`\n\nThe default value if no match was found.\n","_attachments":{},"homepage":"https://github.com/sindresorhus/yn#readme","bugs":{"url":"https://github.com/sindresorhus/yn/issues"},"license":"MIT"}