yn alternatives and similar modules
Based on the "Command Line Utilities" category.
Alternatively, view yn alternatives based on common mentions on social networks and blogs.
-
KeyboardJS
A JavaScript library for binding keyboard combos without the pain of key codes and key combo conflicts. -
omelette
Omelette is a simple, template based autocompletion tool for Node and Deno projects with super easy API. (For Bash, Zsh and Fish) -
log-update
Log by overwriting the previous output in the terminal. Useful for rendering progress bars, animations, etc. -
insight
Node.js module to help you understand how your tool is being used by anonymously reporting usage metrics to Google Analytics -
multispinner
Multiple, simultaneous, individually controllable spinners for concurrent tasks in Node.js CLI programs -
ANSI Styles
CJS/ESM ANSI color library for CI, terminals and Chromium-based browser consoles. Compatible with Bun, Deno, Next.JS.
CodeRabbit: AI Code Reviews for Developers

* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of yn or a related project?
Popular Comparisons
README
yn
Parse yes/no like values
Useful for validating answers of a CLI prompt.
The following case-insensitive values are recognized:
'y', 'yes', 'true', true, '1', 1, 'n', 'no', 'false', false, '0', 0, 'on', 'off'
Enable lenient mode to gracefully handle typos.
Install
$ npm install yn
Usage
import yn from 'yn';
yn('y');
//=> true
yn('NO');
//=> false
yn(true);
//=> true
yn('abomasum');
//=> undefined
yn('abomasum', {default: false});
//=> false
yn('mo', {lenient: true});
//=> false
Unrecognized values return undefined
.
API
yn(input, options?)
input
Type: unknown
The value that should be converted.
options
Type: object
lenient
Type: boolean
\
Default: false
Use a key distance-based score to leniently accept typos of yes
and no
.
default
Type: boolean
\
Default: undefined
The default value if no match was found.