Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

std-env

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

std-env - npm Package Compare versions

Comparing version 2.3.1 to 3.0.0-0

dist/index.cjs

26

package.json
{
"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
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc