lockfile-info
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

lockfile-info Version Badge

github actions coverage License Downloads

npm badge

Info about an npm project - which lockfile version, which lockfile(s) are present, etc.

Example

const lockfileInfo = require('lockfile-info');
const assert = require('assert');

lockfileInfo().then((results) => {
	assert.deepEqual(Object.keys(results), [
		'hasPackageJSON',
		'hasNodeModulesDir',
		'hasLockfile',
		'hasPackageLock',
		'hasShrinkwrap',
		'lockfileVersion',
	]);

	assert.equal(typeof results.hasPackageJSON, 'boolean');
	assert.equal(typeof results.hasNodeModulesDir, 'boolean');
	assert.equal(typeof results.hasLockfile, 'boolean');
	assert.equal(typeof results.hasPackageLock, 'boolean');
	assert.equal(typeof results.hasShrinkwrap, 'boolean');
	assert.equal(typeof results.lockfileVersion, 'number'); // `NaN`, `1`, `2`, or `3`
});

Package Sidebar

Install

npm i lockfile-info

Weekly Downloads

9,399

Version

1.1.0

License

MIT

Unpacked Size

12.6 kB

Total Files

10

Last publish

Collaborators

  • ljharb