- NPM package that gets information about npm packages and other info from the NPM API
Installation from NPM
npm i npm-searcher
search(package_name)
- Get a npm packagepackage_name
: (REQUIRED) npm package name
const npm = require('npm-searcher')
async function getNpm() {
const res = await npm.search('express')
console.log(res) // All information related to the express package
console.log(res.name) // express
}
getNpm()
const npm = require('npm-searcher')
npm.search('express').then(res => {
console.log(res) // All information related to the express package
console.log(res.name) // express
})
const npm = require('npm-searcher')
npm.search('express').then(res => {
if (res) {
console.log(res) // All information related to the express package
console.log(res.name) // express
} else {
console.log("package not found");
}
})
© npm-searcher, 2021 | abdooo9 (abdooo9.dev@gmail.com)