Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/luftywiranda13/has-package-lock
Check if a `package-lock.json` is present in the working directory
https://github.com/luftywiranda13/has-package-lock
check detect find fs lockfile npm package-lock package-lock-json yarn
Last synced: about 2 months ago
JSON representation
Check if a `package-lock.json` is present in the working directory
- Host: GitHub
- URL: https://github.com/luftywiranda13/has-package-lock
- Owner: luftywiranda13
- License: mit
- Created: 2017-08-11T09:33:02.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-06-03T09:18:07.000Z (over 4 years ago)
- Last Synced: 2024-11-11T22:00:10.347Z (about 2 months ago)
- Topics: check, detect, find, fs, lockfile, npm, package-lock, package-lock-json, yarn
- Language: JavaScript
- Size: 110 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# has-package-lock
> Check if a `package-lock.json` is present in the working directory
[![Package Version](https://img.shields.io/npm/v/has-package-lock.svg?style=flat-square)](https://www.npmjs.com/package/has-package-lock)
[![Downloads Status](https://img.shields.io/npm/dm/has-package-lock.svg?style=flat-square)](https://npm-stat.com/charts.html?package=has-package-lock&from=2016-04-01)
[![Build Status: Linux](https://img.shields.io/travis/luftywiranda13/has-package-lock/master.svg?style=flat-square)](https://travis-ci.org/luftywiranda13/has-package-lock)
[![Coverage Status](https://img.shields.io/codecov/c/github/luftywiranda13/has-package-lock/master.svg?style=flat-square)](https://codecov.io/gh/luftywiranda13/has-package-lock)## Installation
```sh
npm install has-package-lock
```## Usage
```sh
$ tree
.
├── bar
│ ├── package-lock.json
│ └── package.json
└── foo
└── package.json
``````js
const hasPackageLock = require('has-package-lock');hasPackageLock('bar');
//=> truehasPackageLock('foo');
//=> false
```## API
### hasPackageLock([cwd])
Returns `boolean`.
#### cwd
Type: `string`
Default: `process.cwd()`Current working directory.
## Related
* [has-lockfile](https://github.com/luftywiranda13/has-lockfile) - Check which lockfile is present in the working directory
* [has-yarn](https://github.com/sindresorhus/has-yarn) - Check if a project is using Yarn
* [pkg-man](https://github.com/luftywiranda13/pkg-man) - Detect which package manager that should be used## License
MIT © [Lufty Wiranda](https://www.luftywiranda.com)