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
32
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 3.0.0-alpha to 3.0.0

dist/index.cjs

33

package.json
{
"name": "std-env",
"version": "3.0.0-alpha",
"description": "Detect running environment of the current Node.js process",
"version": "3.0.0",
"description": "Detect current Javascript environment",
"repository": "unjs/std-env",
"license": "MIT",
"main": "index.js",
"types": "index.d.ts",
"repository": "nuxt-contrib/std-env",
"contributors": [
"Pooya Parsa <pooya@pi0.ir>"
"sideEffects": false,
"exports": {
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
},
"main": "./dist/index.cjs",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"dependencies": {
"ci-info": "^2.0.0"
"scripts": {
"prepack": "unbuild",
"release": "yarn test && standard-version && git push --follow-tags && npm publish",
"test": "node test.cjs"
},
"files": [
"index.js",
"index.d.ts"
]
"devDependencies": {
"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)
[![bundlephobia](https://img.shields.io/bundlephobia/min/std-env/latest.svg?style=flat-square)](https://bundlephobia.com/result?p=std-env)
Detect running environment of the current Node.js process.
> Detect current Javascript environment
## Installation
Using yarn:
```
```sh
# Using Yarn
yarn add std-env
```
Usin npm:
```
# Using npm
npm i std-env

@@ -25,25 +22,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