Check if your code is running as an npm or yarn script
Installations
npm install is-npm
Developer Guide
Typescript
No
Module System
ESM
Min. Node Version
^12.20.0 || ^14.13.1 || >=16.0.0
Node Version
16.9.1
NPM Version
7.20.3
Score
98.4
Supply Chain
82.2
Quality
75.4
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (75.1%)
TypeScript (24.9%)
Developer
sindresorhus
Download Statistics
Total Downloads
2,280,163,544
Last Day
761,157
Last Week
6,050,748
Last Month
28,392,279
Last Year
331,142,465
GitHub Statistics
64 Stars
21 Commits
10 Forks
6 Watching
1 Branches
8 Contributors
Bundle Size
542.00 B
Minified
313.00 B
Minified + Gzipped
Sponsor this package
Package Meta Information
Latest Version
6.0.0
Package Id
is-npm@6.0.0
Size
1.99 kB
NPM Version
7.20.3
Node Version
16.9.1
Publised On
18 Sept 2021
Total Downloads
Cumulative downloads
Total Downloads
2,280,163,544
Last day
-34.8%
761,157
Compared to previous day
Last week
-8.1%
6,050,748
Compared to previous week
Last month
-9.5%
28,392,279
Compared to previous month
Last year
-9.7%
331,142,465
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
is-npm
Install
1npm install is-npm
Usage
1import {isNpmOrYarn, isNpm, isYarn} from 'is-npm'; 2 3console.table({isNpmOrYarn, isNpm, isYarn});
1$ node foo.js 2# ┌─────────────┬────────┐ 3# │ (index) │ Values │ 4# ├─────────────┼────────┤ 5# │ isNpmOrYarn │ false │ 6# │ isNpm │ false │ 7# │ isYarn │ false │ 8# └─────────────┴────────┘ 9$ npm run foo 10# ┌─────────────┬────────┐ 11# │ (index) │ Values │ 12# ├─────────────┼────────┤ 13# │ isNpmOrYarn │ true │ 14# │ isNpm │ true │ 15# │ isYarn │ false │ 16# └─────────────┴────────┘ 17$ yarn run foo 18# ┌─────────────┬────────┐ 19# │ (index) │ Values │ 20# ├─────────────┼────────┤ 21# │ isNpmOrYarn │ true │ 22# │ isNpm │ false │ 23# │ isYarn │ true │ 24# └─────────────┴────────┘
Related
- is-npm-cli - CLI for this module
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
security policy file detected
Details
- Info: security policy file detected: .github/security.md:1
- Info: Found linked content: .github/security.md:1
- Info: Found disclosure, vulnerability, and/or timelines in security policy: .github/security.md:1
- Info: Found text in security policy: .github/security.md:1
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: license:0
- Info: FSF or OSI recognized license: MIT License: license:0
Reason
Found 7/21 approved changesets -- score normalized to 3
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/main.yml:1
- Info: no jobLevel write permissions found
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/sindresorhus/is-npm/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/sindresorhus/is-npm/main.yml/main?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/main.yml:20
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 npmCommand dependencies pinned
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'main'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 7 are checked with a SAST tool
Score
4.3
/10
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More