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.5.tar.gz
(12.5 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.5.tar.gz.
File metadata
- Download URL: static_npm-1.0.5.tar.gz
- Upload date:
- Size: 12.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2bbabed5de04041223e8f4e61940efe1f1e9c21a8441ce95221d83fd753e01b
|
|
| MD5 |
1ec02b77db09ad1f6f56bc646b87f16f
|
|
| BLAKE2b-256 |
93f3fd67e692b5a76d789b6490a0e7c1ee6bf5f781f3d6f6c21dfff382d2e1c4
|
File details
Details for the file static_npm-1.0.5-py2.py3-none-any.whl.
File metadata
- Download URL: static_npm-1.0.5-py2.py3-none-any.whl
- Upload date:
- Size: 9.0 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 |
22009fdec8b675efc610fc2528a71341083466b8523896fa0cdbab8ee7d54f6b
|
|
| MD5 |
8a4e9ac39389bae2d51dbdcce0be552a
|
|
| BLAKE2b-256 |
174017014499f3196b19beef565a22135df8de37d2271f29011746ad3228f968
|