Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

has-package-lock

luftywiranda1335MIT2.0.0

Check if a package-lock.json is present in the working directory

app, detect, has, is, lock file, lockfile, manager, module, npm, package-lock.json, package-lock, package, project, yarn

readme

has-package-lock

Check if a package-lock.json is present in the working directory

Package Version Downloads Status Build Status: Linux Coverage Status

Installation

npm install --save has-package-lock

Usage

$ tree
.
├── bar
│   ├── package-lock.json
│   └── package.json
└── foo
    └── package.json
const hasPackageLock = require('has-package-lock');

hasPackageLock('bar');
//=> true

hasPackageLock('foo');
//=> false

API

hasPackageLock([cwd])

Returns boolean.

cwd

Type: string
Default: process.cwd()

Current working directory.

  • has-lockfile - Check which lockfile is present in the working directory
  • has-yarn - Check if a project is using Yarn
  • pkg-man - Detect which package manager that should be used

License

MIT © Lufty Wiranda