check-npm-name
v1.0.3
Published
Check is name available in npmjs.com. Lightweight. 100% versions support. Zero dependency
Downloads
58
Maintainers
Readme
check-npm-name
Zero dependency micro-library that returns true
if the name is already taken and false
if the name is still available.
Usage
const check = require('check-npm-name')
check('check-npm-name')
.then((isTaken) => {
console.log(isTaken) // true
})
import check from 'check-npm-name'
async function foo() {
const isAlreadyTaken = await check('react')
console.log(isAlreadyTaken) // true
const isAlreadyTaken2 = await check('giant-citrus-is-looking-for-you')
console.log(isAlreadyTaken2) // false
}
Features
You can get detailed report about requested package
const check = require('check-npm-name')
async function foo() {
const detailedResponse = await check('neura', {full: true})
console.log(detailedResponse)
/**
*{
* time: { created: '2017-07-03T17:38:47.172Z'},
* homepage: 'https://github.com/neura-js/neura#readme',
* keywords: [
* 'javascript',
* 'science',
* 'matrix',
* 'array',
* 'neural network',
* 'js',
* 'machine learning'
* ],
* repository: { type: 'git', url: 'git+https://github.com/neura-js/neura.git' },
* author: { name: 'alexile' },
* bugs: { url: 'https://github.com/neura-js/neura/issues' },
* license: 'MIT',
* readmeFilename: 'README.md'
*}
*/
}