1.0.0 • Published 4 months ago

pkgplz v1.0.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
4 months ago

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.

npm npm downloads license

Installation

npm install pkgplz
yarn add pkgplz

Usage

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.