is-npm

WebJar for is-npm

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

is-npm
Last Version

Last Version

4.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

is-npm
WebJar for is-npm
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/sindresorhus/is-npm

Download is-npm

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/is-npm/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>is-npm</artifactId>
    <version>4.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/is-npm/
implementation 'org.webjars.npm:is-npm:4.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/is-npm/
implementation ("org.webjars.npm:is-npm:4.0.0")
'org.webjars.npm:is-npm:jar:4.0.0'
<dependency org="org.webjars.npm" name="is-npm" rev="4.0.0">
  <artifact name="is-npm" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='is-npm', version='4.0.0')
)
libraryDependencies += "org.webjars.npm" % "is-npm" % "4.0.0"
[org.webjars.npm/is-npm "4.0.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

is-npm Build Status

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

Install

$ npm install is-npm

Usage

const {isNpmOrYarn, isNpm, isYarn} = require('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  │
# └─────────────┴────────┘

Related


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.

Versions

Version
4.0.0
3.0.0
1.0.0