consistent-path

2.0.3 • Public • Published

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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.0.35latest

Version History

VersionDownloads (Last 7 Days)Published
2.0.35
2.0.20
2.0.10
2.0.00
1.1.10
1.0.30
1.0.20
1.0.10
1.0.00

Package Sidebar

Install

npm i consistent-path

Weekly Downloads

5

Version

2.0.3

License

MIT

Last publish

Collaborators

  • steelbrain