Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inBook a demo

is-npm

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Issues
File Explorer

Advanced tools

is-npm

Check if your code is running as an npm script

    6.0.0latest

Version published
Maintainers
1
Weekly downloads
7,626,900
decreased by-12.48%

Weekly downloads

Changelog

Source

Breaking

  • Require Node.js 12.20 8cd7b4a
  • This package is now pure ESM. Please read this.

https://github.com/sindresorhus/is-npm/compare/v5.0.0...v6.0.0

Readme

Source

is-npm

Check if your code is running as an npm or yarn script

Install

npm install is-npm

Usage

import {isNpmOrYarn, isNpm, isYarn} from 'is-npm'; console.table({isNpmOrYarn, isNpm, isYarn}); $ node foo.js # ┌─────────────┬────────┐ # │ (index) │ Values │ # ├─────────────┼────────┤ # │ isNpmOrYarn │ false │ # │ isNpm │ false │ # │ isYarn │ false │ # └─────────────┴────────┘ $ npm run foo # ┌─────────────┬────────┐ # │ (index) │ Values │ # ├─────────────┼────────┤ # │ isNpmOrYarn │ true │ # │ isNpm │ true │ # │ isYarn │ false │ # └─────────────┴────────┘ $ yarn run foo # ┌─────────────┬────────┐ # │ (index) │ Values │ # ├─────────────┼────────┤ # │ isNpmOrYarn │ true │ # │ isNpm │ false │ # │ isYarn │ true │ # └─────────────┴────────┘
Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Keywords

FAQs

What is is-npm?

Check if your code is running as an npm script

Is is-npm popular?

The npm package is-npm receives a total of 6,135,897 weekly downloads. As such, is-npm popularity was classified as popular.

Is is-npm well maintained?

We found that is-npm demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.It has 1 open source maintainer collaborating on the project.

Last updated on 18 Sep 2021

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc