Gathering detailed insights and metrics for yesno
Gathering detailed insights and metrics for yesno
Gathering detailed insights and metrics for yesno
Gathering detailed insights and metrics for yesno
A simple library for asking boolean questions in cli programs
npm install yesno
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
38 Stars
40 Commits
5 Forks
3 Watching
1 Branches
4 Contributors
Updated on 20 Sept 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
8.4%
32,005
Compared to previous day
Last week
0.8%
166,613
Compared to previous week
Last month
10.1%
693,178
Compared to previous month
Last year
3.3%
7,045,120
Compared to previous year
1
A nodejs library for issuing and handling responses to yes/no questions
Supports Node 8+.
1npm install yesno
1import yesno from 'yesno'; // modern es modules approach 2 3// *OR* 4 5const yesno = require('yesno'); // commonjs approach
1const ok = await yesno({ 2 question: 'Are you sure you want to continue?' 3});
yesno accepts yes
, y
, no
, and n
values by default.
All yesno responses are case insensitive.
1const ok = await yesno({ 2 question: 'Dude, Is this groovy or what?', 3 yesValues: [ 'groovy' ], 4 noValues: [ 'or what', 'nah' ] 5}); 6 7console.log(ok ? 'Tubular.' : 'Aw, why you gotta be like that?');
Now the question only responds to groovy
as yes and or what
as no.
Sometimes you may want to ensure the user didn't accidentally accept a default. You can disable the default response by passing null as the defaultValue parameter.
1const ok = await yesno({ 2 question: 'Are you sure you want to 'rm-rf /' ?', 3 defaultValue: null 4});
By default, if the user enters a value that isn't recognized as an acceptable response, it will print out a message like:
Invalid response.
Answer either yes : (yes, y)
Or no : (no, n)
and re-ask the question. If you want to change this behavior, you can set the invalid handler before asking your question:
1const ok = await yesno({ 2 question: 'Ready to continue?', 3 invalid: function ({ question, defaultValue, yesValues, noValues }) { 4 process.stdout.write("\n Whoa. That was not a good answer. Well. No more tries for you."); 5 process.exit(1); 6 } 7});
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 1/29 approved changesets -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More