1.0.0 • Published 8 months ago
pkgplz v1.0.0
pkgplz
Enterprise-level package getter.
All journeys begin at the root—so does this one—
pkgplz asynchronously retrieves the package.json at root and returns null if none is found.
Installation
npm install pkgplzyarn add pkgplzUsage
The default import is asynchronous
ESM Module (Async)
import pkgplz from 'pkgplz';
const pkg = await pkgplz();
console.log(pkg?.name); CommonJS (Async)
const pkgplz = require('pkgplz');
pkgplz().then(pkg => {
console.log(pkg?.name);
});Sync is also supported
ESM Module (Sync)
import pkgplz from 'pkgplz/sync';
const pkg = pkgplz();
console.log(pkg?.name);CommonJS (Sync)
const pkgplz = require('pkgplz/sync');
const pkg = pkgplz();
console.log(pkg?.name);Silence the unknown. Know your package—
License
Licensed under the Apache License 2.0.