Programmatic APIs for npm
# npm
npm install @keqingrong/npm-apis
# yarn
yarn add @keqingrong/npm-apis
import { outdated } from '@keqingrong/npm-apis';
(async () => {
const result = await outdated(
{
json: true,
long: true
},
{ cwd: __dirname }
);
const outdatedJson = JSON.parse(result);
console.log(outdatedJson);
})();
-
install(pkg)
Install a package -
outdated()
Check for outdated packages -
version(release)
Bump a package version -
spawnAsync()
Promisifiedchild_process.spawn()
MIT © Qingrong Ke
Official packages from the npm team: