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.4.tar.gz (12.5 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.4-py2.py3-none-any.whl (9.0 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

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

Hashes for static_npm-1.0.4.tar.gz
Algorithm Hash digest
SHA256 46fd7fc8f5a81287c82e71a22e2cdf54590977779598d312b3c31f1a4c0e4af9
MD5 8c3f1c7c2ce8f41fe408d7abafb0ac91
BLAKE2b-256 c8b2fb322e69372d07d3433b54fb9df84ddbe115b408b6411350a66f7638d74f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: static_npm-1.0.4-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.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8f78249082be8ffd46c7f2d0d9828ce71f49477f566e689968b13ff43a771700
MD5 af2186f47b1a7cf43961f3af5bfdf8bc
BLAKE2b-256 851e35633ba496480207183108f6c2fc6a043f3aa89892dc05363cc3bb01922e

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