A wrapper for npm that stores node_modules outside of project and provides easy access to them.
Project description
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+
CLI usage
npmenv 0.0.0
env-list List all currently existing environments
env-location Output path to env for current dir (may not exist yet)
env-run cmd [args] Run command with env's bin dir in start of PATH
env-rm [env_id] Remove the env for current dir (or env with given id)
env-cleanup Remove envs for projects that no longer exist
Module API
Exception for npmenv-related issues
env_cleanup() -> list
Remove envs for projects that no longer exist (no package or lock file)
env_list() -> list
Return list of npmenv ids and their corresponding project dirs
env_location(proj_dir:Union[pathlib.Path, str]=None) -> pathlib.Path
Return env dir path for given project dir (may/may not exist yet)
env_npm(args:str='', proj_dir:Union[pathlib.Path, str]=None) -> subprocess.CompletedProcess
Execute npm with given args in env dir of given project dir
env_rm(identifier:Union[pathlib.Path, str]=None) -> str
Remove the env for given project dir or env id (defaults to CWD)
env_run(args:str, proj_dir:Union[pathlib.Path, str]=None) -> subprocess.CompletedProcess
Run a command with node_modules/.bin at start of PATH environment variable
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file npmenv-0.0.0.tar.gz
.
File metadata
- Download URL: npmenv-0.0.0.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eed36ee639faece1dfb747ffd8b815a027f2fddd3e5a67aa94ec1f748a7097ab |
|
MD5 | 7073533e80612643809e1dec46a6b9bb |
|
BLAKE2b-256 | 4e565c89630f163ac26c08207454d41655bd8fc668cad05d04cf51df78b0f3d0 |
Provenance
File details
Details for the file npmenv-0.0.0-py3-none-any.whl
.
File metadata
- Download URL: npmenv-0.0.0-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd3fe45b6572e95a0510feec08cd298ef506227c73c237b3e11f80c85441ac07 |
|
MD5 | 9b99153ce72e66777e220771d83cc2bf |
|
BLAKE2b-256 | c244db5eb11ab78d5d8a38b4e7e2a2b5555f861d3ac136c443928e279b99447a |