https://github.com/ljharb/lockfile-info
Info about an npm project - which lockfile version, which lockfile(s) are present, etc.
https://github.com/ljharb/lockfile-info
Last synced: 5 months ago
JSON representation
Info about an npm project - which lockfile version, which lockfile(s) are present, etc.
- Host: GitHub
- URL: https://github.com/ljharb/lockfile-info
- Owner: ljharb
- License: mit
- Created: 2021-11-28T22:41:22.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-12-12T17:38:18.000Z (10 months ago)
- Last Synced: 2025-01-08T17:05:03.263Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 32.2 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# lockfile-info [![Version Badge][npm-version-svg]][package-url]
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url][![npm badge][npm-badge-png]][package-url]
Info about an npm project - which lockfile version, which lockfile(s) are present, etc.
## Example
```js
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-url]: https://npmjs.org/package/lockfile-info
[npm-version-svg]: https://versionbadg.es/ljharb/lockfile-info.svg
[deps-svg]: https://david-dm.org/ljharb/lockfile-info.svg
[deps-url]: https://david-dm.org/ljharb/lockfile-info
[dev-deps-svg]: https://david-dm.org/ljharb/lockfile-info/dev-status.svg
[dev-deps-url]: https://david-dm.org/ljharb/lockfile-info#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/lockfile-info.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/lockfile-info.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/lockfile-info.svg
[downloads-url]: https://npm-stat.com/charts.html?package=lockfile-info
[codecov-image]: https://codecov.io/gh/ljharb/lockfile-info/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/ljharb/lockfile-info/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/lockfile-info
[actions-url]: https://github.com/ljharb/lockfile-info/actions