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.6.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.6-py2.py3-none-any.whl (9.1 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: static_npm-1.0.6.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.6.tar.gz
Algorithm Hash digest
SHA256 a63fbf7026c98d18d0e70c5da76577d22e17dfa54c7db47e310d8e4b582bc2cb
MD5 df73cc077ecb3bfece80c918a986845c
BLAKE2b-256 1ddfd8613a8162bc591154a8df8fbfbce67ca87a4bd9234b7eb2edc2b41b32b6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: static_npm-1.0.6-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.1 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.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 eee9c2bc21008bc6e8e6df3558941268a658d6a232a5a50e2bf7a3d432553351
MD5 7a9755542df4d8b3a4b5bb628b888f48
BLAKE2b-256 4399c32bd7a98c5782b6899d2fac1fa6d59831b0159a22e0be3cd431782148f5

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