Skip to main content

Node.js is an open-source, cross-platform, back-end JavaScript runtime environment that runs on the V8 engine and executes JavaScript code outside a web browser.

Project description

Node.js PyPI distribution

Node.js is an open-source, cross-platform, back-end JavaScript runtime environment that runs on the V8 engine and executes JavaScript code outside a web browser.

Note: this is an unofficial Node.js distribution.

The nodejs-bin Python package redistributes Node.js so that it can be used as a dependency of Python projects.

This is intended for use within Python virtual environments and containers, it should probably not be used for global instillation.

This PyPI distribution is provided by https://github.com/samwillis/nodejs-pypi.

Usage

To install:

pip install nodejs-bin

To run Node.js from the command line, use:

python -m nodejs
# or (see below)
node

npm and npx are also available as python -m nodejs.npm and python -m nodejs.npx.

To run Node.js from a Python program:

from nodejs import node, npm, npm

# Run Node.js and return the exit code.
node.run(['script.js', 'arg1', ...])

# Run npm and return the exit code.
npm.run(['command', 'arg1', ...])

# Run npx and return the exit code.
npx.run(['command', 'arg1', ...])

Alternatively use sys.executable to locate the Python binary to invoke. For example:

import sys, subprocess

subprocess.call([sys.executable, "-m", "nodejs"])

Additionally, the standard node, npm and npx commands are also added to your Python environment's bin directory. This is usually on your PATH and so they should be available in your shell environment.

License

The Node.js license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

nodejs_bin-16.15.1a1-py3-none-win_amd64.whl (27.6 MB view hashes)

Uploaded Python 3 Windows x86-64

nodejs_bin-16.15.1a1-py3-none-win32.whl (25.9 MB view hashes)

Uploaded Python 3 Windows x86

nodejs_bin-16.15.1a1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (31.7 MB view hashes)

Uploaded Python 3 manylinux: glibc 2.17+ ARMv7l

nodejs_bin-16.15.1a1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (34.5 MB view hashes)

Uploaded Python 3 manylinux: glibc 2.17+ ARM64

nodejs_bin-16.15.1a1-py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (34.5 MB view hashes)

Uploaded Python 3 manylinux: glibc 2.12+ x86-64

nodejs_bin-16.15.1a1-py3-none-macosx_11_0_arm64.whl (30.7 MB view hashes)

Uploaded Python 3 macOS 11.0+ ARM64

nodejs_bin-16.15.1a1-py3-none-macosx_10_9_x86_64.whl (32.2 MB view hashes)

Uploaded Python 3 macOS 10.9+ x86-64

Supported by

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