Skip to main content

static binaries of npm and node

Project description

static-npm

Downloads and runs npm, npx and node through static binary downloads.

Linting MacOS_Tests Ubuntu_Tests Win_Tests

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


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.3.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

static_npm-1.0.3-py2.py3-none-any.whl (9.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file static_npm-1.0.3.tar.gz.

File metadata

  • Download URL: static_npm-1.0.3.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.5

File hashes

Hashes for static_npm-1.0.3.tar.gz
Algorithm Hash digest
SHA256 aa55f1061911d21e57ee506348a205043131c5499ac195c1b2043d83527859e4
MD5 2ae0a493018fe982b633d0b59f47fe44
BLAKE2b-256 5ca1101eda7ee7e9e1da3a1c80b8f07a33a9247ce4cba44f5d2d71564d417374

See more details on using hashes here.

File details

Details for the file static_npm-1.0.3-py2.py3-none-any.whl.

File metadata

  • Download URL: static_npm-1.0.3-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

Hashes for static_npm-1.0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 395eb307d82c67b981c2db1a965f5b7489f641a30f0d65cbd15966727349b8ff
MD5 279134e48c22b5bda9882656c089b843
BLAKE2b-256 f4b99c65f4eba17a25d34fd7c4f04bbca052dd1dc9570557476332a246e34f3f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page