has-pnpm

Check if a project is using pnpm.

Usage no npm install needed!

<script type="module">
  import hasPnpm from 'https://cdn.skypack.dev/has-pnpm';
</script>

README

has-pnpm

NPM npm npm npm type definitions Gitlab pipeline status

Check if a project is using pnpm.

It'll check whether shrinkwrap.yaml or pnpm-lock.yaml exists in current working directory.

Installation

npm install has-pnpm
# or
yarn add has-pnpm
# or
pnpm install has-pnpm

CLI

You can also install as global package to use CLI.

npm install -g has-pnpm
# or
yarn global add has-pnpm
has-pnpm

Check if a project is using pnpm.

Options:
  --help, -h     Show help                                             [boolean]
  --version, -v  Show version number                                   [boolean]

Usage

├── a
│   ├── package.json
│   └── package-lock.json
├── b
│   ├── package.json
│   └── shrinkwrap.yaml
└── c
    ├── package.json
    └── pnpm-lock.yaml
const hasPNPM = require('has-pnpm');

hasPNPM('a'); // => false
hasPNPM('b'); // => true
hasPNPM('c'); // => true

API

hasPNPM(cwd)

Return: boolean

Return result of checking pnpm usage.

cwd

Type: string
Default: process.cwd()

Current working directory.

Related