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

shell-env

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shell-env

Get environment variables from the shell

  • 2.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.4K
decreased by-57.21%
Maintainers
2
Weekly downloads
 
Created
Source

shell-env Build Status

Get environment variables from the shell

Especially useful for Electron/NW.js apps as GUI apps on macOS doesn't inherit the environment variables defined in your dotfiles (.bashrc/.bash_profile/.zshrc/etc).

Install

$ npm install shell-env

Usage

const shellEnv = require('shell-env');

console.log(shellEnv.sync());
//=> {TERM_PROGRAM: 'Apple_Terminal', SHELL: '/bin/zsh', ...}

console.log(shellEnv.sync('/bin/bash'));
//=> {TERM_PROGRAM: 'iTerm.app', SHELL: '/bin/zsh', ...}

API

shellEnv([shell])

Return a promise for the environment variables.

shellEnv.sync([shell])

Returns the environment variables.

shell

Type: string
Default: User default shell

Shell to read the environment variables from.

  • shell-path - Get the $PATH from the shell
  • fix-path - Fix the $PATH on macOS when run from a GUI app
  • shell-history - Get the command history of the user's shell

Maintainers

License

MIT

Keywords

FAQs

Package last updated on 01 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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