{"name":"yn","version":"5.1.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","types":"./index.d.ts","sideEffects":false,"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"},"_id":"yn@5.1.0","gitHead":"a4d33dd53c27a1a3771f11a7790420d99fc4115d","bugs":{"url":"https://github.com/sindresorhus/yn/issues"},"homepage":"https://github.com/sindresorhus/yn#readme","_nodeVersion":"20.19.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-TfXLvT6eVsBNIm8rAXTwJYdQFtOXaHQ+rA7LU8HL8C/BFfaSfhvFE5T1rHAdBCbAj808HaqjXVkmo8jmeGOqhw==","shasum":"4e7403e837b687c3708ae29dc2386e68c143d325","tarball":"http://registry-npm.ywwl.com/yn/download/yn-5.1.0.tgz","fileCount":6,"unpackedSize":6134,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCjIe/TEckOFsjU1JT1ofvAGQQbAMxIWFWQ+OAorR4jRQIhALiKUr43S4J8/U7IzPRSQI6NpI/TWraSDxMhFnocME0M"}],"size":2654,"noattachment":false,"key":"/yn/-/yn-5.1.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/yn_5.1.0_1755852894068_0.1675730196390104"},"_hasShrinkwrap":false,"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', 't', 'true', true, '1', 1, 'n', 'no', 'f', 'false', false, '0', 0, 'on', 'off'\n```\n\n*Enable lenient mode to gracefully handle typos.*\n\n## Install\n\n```sh\nnpm 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","publish_time":1755852894259,"_cnpm_publish_time":1755852894259,"dist-tags":{"latest":"5.1.0"}}