Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
github.com/faressoft/inquirer-checkbox-plus-prompt
A plugin for Inquirer, similar to the original checkbox with extra features.
The animated GIF is made by Terminalizer
npm install inquirer-checkbox-plus-prompt
You can name it with any name other than checkbox-plus
, just change the string 'checkbox-plus'
to anything else.
inquirer.registerPrompt('checkbox-plus', require('inquirer-checkbox-plus-prompt'));
inquirer.prompt({
type: 'checkbox-plus',
...
})
Takes type
, name
, message
, source
[, filter
, validate
, default
, pageSize
, highlight
, searchable
] properties.
The extra options that this plugin provides are:
choices
option in the original checkbox
prompt of Inquirer
.true
, the current selected choice gets highlighted. Default: false
.true
, allow the user to filter the list. The source
function gets called everytime the search query is changed. Default: false
.Check example.js for a more advanced example.
var inquirer = require('inquirer');
var fuzzy = require('fuzzy');
inquirer.registerPrompt('checkbox-plus', require('./index'));
var colors = ['red', 'green', 'blue', 'yellow'];
inquirer.prompt([{
type: 'checkbox-plus',
name: 'colors',
message: 'Enter colors',
pageSize: 10,
highlight: true,
searchable: true,
default: ['yellow', 'red'],
source: function(answersSoFar, input) {
input = input || '';
return new Promise(function(resolve) {
var fuzzyResult = fuzzy.filter(input, colors);
var data = fuzzyResult.map(function(element) {
return element.original;
});
resolve(data);
});
}
}]).then(function(answers) {
console.log(answers.colors);
});
This project is under the MIT license.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.