JSPM

add-to-path

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 8
  • Score
    100M100P100Q43287F
  • License MIT

Cross-platform method to add a directory to your $PATH

Package Exports

  • add-to-path

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (add-to-path) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

add-to-path

Status: npm version npm downloads Build Status Code Coverage

This micro-lib allows you to alter the $PATH in a cross-platform way.

var path = require('path');
var addToPath = require('add-to-path');
var restorePath = addToPath(path.join(process.cwd(), 'node_modules', '.bin'));
// process.env.PATH now starts with the `.bin` in your `node_modules` directory :-)
// unless you happen to be running on windows, in which case it *might* be process.env.Path :-)
// but you don't have to think about that...
// want to restore the path to what it was before you mucked with it?
// just call the function you get back:
restorePath();

Other info

LICENSE -> MIT