static binaries of npm and node
Project description
static-npm
Downloads and runs npm, npx and node through static binary downloads.
Install
pip install static-npm
Cmds
# Get the versions of all tools
static-npm --version
static-node --version
static-npx --version
# Install live-server
static-npm install -g live-server
Api
from pathlib import Path
from static_npm.npm import Npm
from static_npm.npx import Npx
from static_npm.paths import CACHE_DIR
def _get_tool_dir(tool: str) -> Path:
return CACHE_DIR / tool
npm = Npm()
npx = Npx()
tool_dir = _get_tool_dir("live-server")
npm.run(["install", "live-server", "--prefix", str(tool_dir)])
proc = npx.run(["live-server", "--version", "--prefix", str(tool_dir)])
rtn = proc.wait()
stdout = proc.stdout
assert 0 == rtn
assert "live-server" in stdout
To develop software, run . ./activate.sh
Windows
This environment requires you to use git-bash.
Linting
Run ./lint.sh to find linting errors using pylint, flake8 and mypy.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
static_npm-1.0.7.tar.gz
(13.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file static_npm-1.0.7.tar.gz.
File metadata
- Download URL: static_npm-1.0.7.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b3328fe4b56c30e96f765fb204cd5e5a3f20a0366e4f981c16ff7e644fcf8d4
|
|
| MD5 |
d5d59d542f24646cad410dacc41093a9
|
|
| BLAKE2b-256 |
a8c7d29e478f636664569f58e7efbdbe0cb8894be76a6e9dfa419edb85427bc8
|
File details
Details for the file static_npm-1.0.7-py2.py3-none-any.whl.
File metadata
- Download URL: static_npm-1.0.7-py2.py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b75f0345bc9248592df766afedaaf885e568a0a526022dc5942a3560a666c84d
|
|
| MD5 |
f68446a4efdf65d8a7b9a126d50f7292
|
|
| BLAKE2b-256 |
cfbcaa8deb18cc71542b766e03c1a5bbeb86a4567caea6968751a8dc7609506a
|