Comparing version 2.3.1 to 3.0.0-0
{ | ||
"name": "std-env", | ||
"version": "2.3.1", | ||
"description": "Detect running environment of the current Node.js process", | ||
"version": "3.0.0-0", | ||
"description": "Simplified way to detect current running Javascript environment", | ||
"repository": "unjs/std-env", | ||
"license": "MIT", | ||
"main": "./index.js", | ||
"types": "./index.d.ts", | ||
"scripts": { | ||
"release": "standard-version && git push --follow-tags && npm publish" | ||
"sideEffects": false, | ||
"exports": { | ||
"import": "./dist/index.mjs", | ||
"require": "./dist/index.cjs" | ||
}, | ||
"main": "./dist/index.cjs", | ||
"types": "./dist/index.d.ts", | ||
"files": [ | ||
"index.js", | ||
"index.d.ts" | ||
"dist" | ||
], | ||
"dependencies": { | ||
"ci-info": "^3.1.1" | ||
"scripts": { | ||
"prepack": "unbuild", | ||
"release": "yarn test && standard-version && git push --follow-tags && npm publish", | ||
"test": "node test.cjs" | ||
}, | ||
"devDependencies": { | ||
"standard-version": "^9.3.1" | ||
"standard-version": "^9.3.2", | ||
"unbuild": "^0.5.11" | ||
} | ||
} |
# std-env | ||
[![npm](https://img.shields.io/npm/dt/std-env.svg?style=flat-square)](http://npmjs.com/package/std-env) | ||
[![npm](https://img.shields.io/npm/dm/std-env.svg?style=flat-square)](http://npmjs.com/package/std-env) | ||
[![npm](https://img.shields.io/npm/v/std-env.svg?style=flat-square)](http://npmjs.com/package/std-env) | ||
Detect running environment of the current Node.js process. | ||
> Simplified way to detect current running Javascript environment | ||
## Installation | ||
Using Yarn: | ||
``` | ||
```sh | ||
# Using Yarn | ||
yarn add std-env | ||
``` | ||
Using npm: | ||
``` | ||
# Using npm | ||
npm i std-env | ||
@@ -25,25 +21,32 @@ ``` | ||
```js | ||
const env = require('std-env') | ||
// ESM | ||
import { isWindows } from 'std-env' | ||
console.log(env) | ||
/* | ||
{ | ||
browser: false, | ||
test: false, | ||
dev: true, | ||
production: false, | ||
debug: false, | ||
ci: false, | ||
tty: true, | ||
minimalCLI: false, | ||
windows: false, | ||
darwin: true, | ||
linux: false | ||
} | ||
*/ | ||
// CommonJS | ||
const { isCI } = require('std-env') | ||
``` | ||
Available exports: | ||
- `hasTTY` | ||
- `hasWindow` | ||
- `isCI` | ||
- `isDebug` | ||
- `isDevelopment` | ||
- `isLinux` | ||
- `isMacOS` | ||
- `isMinimal` | ||
- `isProduction` | ||
- `isTest` | ||
- `isWindows` | ||
- `platform` | ||
- `provider` | ||
You can read more about how each flag works from [./src/index.ts](./src/index.ts). | ||
List of well known providers can be found from [./src/providers.ts](./src/providers.ts). | ||
## License | ||
MIT |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 4 instances in 1 package
9652
0
212
52
1
2
2
1
- Removedci-info@^3.1.1
- Removedci-info@3.9.0(transitive)