An open API service indexing awesome lists of open source software.

https://github.com/shadow-light/npmenv

A wrapper for npm that stores node_modules outside of project and provides easy access to them.
https://github.com/shadow-light/npmenv

npm pip pipenv python

Last synced: 5 months ago
JSON representation

A wrapper for npm that stores node_modules outside of project and provides easy access to them.

Awesome Lists containing this project

README

          

# npmenv

A wrapper for npm that stores node_modules outside of project and provides easy access to them.

`npmenv` is a Python module inspired by `pipenv` in that it stores packages outside of projects (in an OS-specific dir) to avoid cluttering projects. It also has a `run` command that puts `node_modules/.bin` in `PATH` before running the given command. If you `install node` in a project then it will have the added benefit of using that node version to run your code and third-party scripts. You can then lock down your node version per-project and upgrade them individually when desired.

__Install:__ `pip install npmenv`\
__Supports:__ All platforms (Linux, MacOS, Windows)\
__Requires:__ Python 3.6+

[Documentation](https://pypi.org/project/npmenv/) | [Source](https://github.com/shadow-light/npmenv)

## How it works

Aside from `env-...` commands, npmenv hands over to `npm`. But before handing over, it symlinks your `package.json` and/or `package-lock.json` into the virtual environment and runs npm in that environment. You can access any `node_modules` files via the path returned by `npmenv env-location`, which will stay the same even if the environment is removed and recreated (though not if your project path changes).

__Note:__ npmenv does not handle any other files generated by npm (such as shrinkwrap), though more features may be added in future.