Skip to content

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

License

Notifications You must be signed in to change notification settings

ljharb/lockfile-info

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lockfile-info Version Badge

github actions coverage dependency status dev dependency status 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`
});

About

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

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks