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.
@keg-hub/ask-it
Advanced tools
Wrapper around inquirer to make asking questions in Node CLIs easier.
Add to your package.json
"askIt": "git+https://github.com/keg-hub/askIt.git"
See an example here
;(() => {
const { ask, separator, models } = require('askIt')
// See src/models/models for more information
const questionModelObject = {
// Add the default input model
...models.input,
// Override with custom values
type: 'Question type',
name: 'Name of the question',
message: 'Question to ask',
default: 'Default value if user enters nothing',
}
// Pass the model directly to the ask method
// Returns a value entered by the user or the default
const askResponse = await ask({ ...questionModelObject })
// Ask a true / false question
// Returns a boolean
const confirmResponse = await ask.confirm('Ask a confirm question?')
// Ask for text input
// Returns a string of the entered text
const inputResponse = await ask.input('Ask for text input')
// Ask for a password / secret - input will be hidden
// Returns a string of the entered text
const passwordResponse = await ask.password('Ask for hidden text input')
// Ask for user to select an option from a list of options
// Returns the index of the select option within the passed in array
const listResponse = await ask.promptList([
'Option 1',
'Option 2',
'Option 3',
])
})()
function
Object
- a question model object
function
string
- The true / false question to askstring
used as the question asked to the userfunction
string
- The text input question to askfunction
string
- The text input question to askask.input
, except user input is hiddenfunction
array
- List of options to present to the userindex
of the selected item from the passed in options
function
new inquirer.Separator()
Object
FAQs
Node CLI helper for asking questions
We found that @keg-hub/ask-it demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
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.