Gathering detailed insights and metrics for @abhisekp/inquirer-npm-name
Gathering detailed insights and metrics for @abhisekp/inquirer-npm-name
Gathering detailed insights and metrics for @abhisekp/inquirer-npm-name
Gathering detailed insights and metrics for @abhisekp/inquirer-npm-name
Helper function using inquirer to validate a value provided in a prompt does not exist as an npm package.
npm install @abhisekp/inquirer-npm-name
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
1 Stars
33 Commits
1 Watchers
9 Branches
1 Contributors
Updated on Mar 04, 2023
Latest Version
2.0.3
Package Id
@abhisekp/inquirer-npm-name@2.0.3
Size
2.00 kB
NPM Version
3.9.6
Node Version
6.2.2
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Helper function using inquirer to validate a value provided in a prompt does not exist as a npm package.
If the value is already used as a npm package, then the users will be prompted and asked if they want to choose another one. If so, we'll recurse through the same validation process until we have a name that is unused on the npm registry. This is a helper to catch naming issue in advance, it is not a validation rule as the user can always decide to continue with the same name.
1$ npm install --save @abhisekp/inquirer-npm-name # npm i -S @abhisekp/inquirer-npm-name
1const inquirer = require('inquirer'); 2const askName = require('@abhisekp/inquirer-npm-name'); 3 4askName({ 5 name: 'name', 6 message: 'Module Name' 7}, inquirer).then(answers => { 8 console.log(answers.name); 9});
Inside a Yeoman Generator you'd call it this way:
1const generators = require('yeoman-generator'); 2const inquirer = require('inquirer'); 3const askName = require('@abhisekp/inquirer-npm-name'); 4 5module.exports = generators.Base.extend({ 6 prompting: function () { 7 const appNamePrompt = { 8 type: 'input', 9 name: 'appname', 10 message: 'What would you like to name the app?', 11 default: answers => this.appname, // optional 12 filter: appname => appname.trim().replace(/\s+/g, '-').toLowerCase() // optional 13 }; 14 15 const prompts = []; // other prompts 16 17 return askName(appNamePrompt, this) 18 .then(name => 19 this.prompt(prompts) 20 .then(answers => this.answers = answers) 21 ); 22 } 23});
askName
takes 2 parameters:
prompt
an Inquirer prompt configuration.inquirer
or any object with a obj.prompt()
method.Returns: A Promise
resolved with the answer object.
Thanks goes to these wonderful people (emoji key):
Abhisek Pattnaik 💻 💡 |
---|
This project follows the all-contributors specification. Contributions of any kind welcome!
MIT © Simon Boudrias
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
no SAST tool detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Score
Last Scanned on 2025-07-07
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