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
# Install and run in isolated environment.
static-npm-tool live-server --port=1234
Example: Install npm live-server and use it
# NpmTool handle downloading and running a npm based tool installed in isolation.
import time
from static_npm import NpmTool
live_server = NpmTool("live-server").run([f"--port=8888"])
# Web browser should pop up.
time.sleep(10)
live_server.kill()
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.
Metadata
Release files for static-npm 1.0.13
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| static_npm-1.0.13.tar.gz | 13.8 kB | Without provenance | Details for static_npm-1.0.13.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| static_npm-1.0.13-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for static_npm-1.0.13-py2.py3-none-any.whl |
Total release size: 24.0 kB
Release files / static_npm-1.0.13.tar.gz
| Download URL | static_npm-1.0.13.tar.gz |
|---|---|
| Size | 13.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ef3080d5b1a04f30b9081093f1c4efd4497fabacceae24a257078981fd6a3a41
|
|
BLAKE2b-256 checksum How to use checksums |
c53c411668073d2ee0c1877a194487da347dfa100a1fe049a12778edb12c6485
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.11.5
|
Release files / static_npm-1.0.13-py2.py3-none-any.whl
| Download URL | static_npm-1.0.13-py2.py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
3c74085cd0262ee5915c3ed8e6c1eb6ab5a1eba80329c97ed549d4a401fcc9a3
|
|
BLAKE2b-256 checksum How to use checksums |
c6b72919bd23b180e4db7f2719f63cfb47c4c6d39f553efb2c242ed8dff987fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.11.5
|
Security for static-npm 1.0.13
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.