Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.
steelbrainPublic archive

About

A module to get correct $PATH on OSX that does not modify globals

Resources

Stars

5 stars

Watchers

1 watching

Forks

Latest commit

 

History

51 Commits

Folders and files

Repository files navigation

Consistent-PATH

consistent-path is an npm module that makes sure that you get the correct $PATH value even on GUI apps on OSX. It does not modify the globals and caches the result to avoid unnecessary work.

API

module.exports = function(): string
module.exports.async = function(): Promise<string>

Example Usage

import {spawnSync} from 'child_process'
import getPath from 'consistent-path'

const assign = Object.assign || require('some-object-assign-polyfill')

const env = assign({}, process.env, {PATH: getPath()})
console.log('$PATH', spawnSync('printenv', {env}))

Differences to other packages

Differences to atom-community/environment:

Differences to sindresorhus/fix-path

  • fix-path modifies globals
  • fix-path has duplication of work when multiple modules use it as there's no caching in place

LICENSE

This project is licensed under the terms of MIT License

About

A module to get correct $PATH on OSX that does not modify globals

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages