This release is a pre-release and may not be stable for production use.
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.
The nodejs-bin Python package redistributes Node.js so that it can be used as a dependency of Python projects. With nodejs-bin you can call nodejs, npm and npx from both the command line and a Python API.
Note: this is an unofficial Node.js distribution.
This is intended for use within Python virtual environments and containers, it should probably not be used for global installation.
This PyPI distribution is provided by https://github.com/samwillis/nodejs-pypi.
Install
To install:
pip install nodejs-bin
By default the command line node, npm and npx commands are not installed to prevent collisions with already installed Node.js versions. To install them:
pip install 'nodejs-bin[cmd]'
You can specify the Node.js version to install with:
pip install nodejs-bin==<version>
# Example:
pip install nodejs-bin==16.15.1
Command Line Usage
To run Node.js from the command line, use:
python -m nodejs
npm and npx are also available as nodejs.npm and nodejs.npx:
python -m nodejs.npm
python -m nodejs.npx
If you installed the optional command line commands with pip install 'nodejs-bin[cmd]' (see above), you can use them directly from the command line as you would normally with Node.js:
node
npm
npx
Python API Usage
node-bin has a simple Python API that wraps the Node.js command line with the Python subprocess.
For node, npm and npx there are .call(), .run() and .Popen() methods that match the equivalent subprocess methods.
To run Node.js from a Python program and return the exit code:
from nodejs import node, npm, npx
# Run Node.js and return the exit code.
node.call(['script.js', 'arg1', ...], **kwargs)
# Run npm and return the exit code.
npm.call(['command', 'arg1', ...], **kwargs)
# Run npx and return the exit code.
npx.call(['command', 'arg1', ...], **kwargs)
The call(args, **kwargs) functions wrap subprocess.call(), passes though all kwargs and returns the exit code of the process.
To run Node.js from a Python program and return a CompletedProcess object:
from nodejs import node, npm, npx
# Run Node.js and return the exit code.
node.run(['script.js', 'arg1', ...], **kwargs)
# Run npm and return the exit code.
npm.run(['command', 'arg1', ...], **kwargs)
# Run npx and return the exit code.
npx.run(['command', 'arg1', ...], **kwargs)
The run(args, **kwargs) functions wrap subprocess.run(), passes though all kwargs and returns a CompletedProcess.
Additionally, to start a Node.js process and return a subprocess.Popen object, you can use the Popen(args, **kwargs) functions:
from nodejs import node, npm, npx
# Start Node.js and return the Popen object.
node_process = node.Popen(['script.js', 'arg1', ...], **kwargs)
# Start npm and return the Popen object.
npm_process = npm.Popen(['command', 'arg1', ...], **kwargs)
# Start npx and return the Popen object.
npx_process = npx.Popen(['command', 'arg1', ...], **kwargs)
The Popen(args, **kwargs) functions wrap subprocess.Popen(), passes though all kwargs and returns a Popen object.
The nodejs.node api is also available as nodejs.run and nodejs.call and nodejs.Popen.
Finally, there are a number of convenient attributes on the nodejs module:
nodejs.node_version: the version of Node.js that is installed.nodejs.path: the path to the Node.js executable.
Versions
nodejs-bin offers Node.js Current and LTS (long-term support) versions. See the Node.js Documentation for more information.
The full list of versions is available on PyPI is here: https://pypi.org/project/nodejs-bin/#history
License
The Node.js license.
Metadata
Release files for nodejs-bin 18.4.0a4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| nodejs_bin-18.4.0a4-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details |
| nodejs_bin-18.4.0a4-py3-none-win32.whl | Python 3 | none | Windows x86-32 | Details |
| nodejs_bin-18.4.0a4-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl | Python 3 | none | Linux glibc 2.17+ ARMv7l | Details |
| nodejs_bin-18.4.0a4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | Python 3 | none | Linux glibc 2.17+ ARM64 | Details |
| nodejs_bin-18.4.0a4-py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl | Python 3 | none | Linux glibc 2.12+ x86-64 | Details |
| nodejs_bin-18.4.0a4-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details |
| nodejs_bin-18.4.0a4-py3-none-macosx_10_9_x86_64.whl | Python 3 | none | macOS 10.9+ x86-64 | Details |
Total release size: 283.6 MB
Release files / nodejs_bin-18.4.0a4-py3-none-win_amd64.whl
| Download URL | nodejs_bin-18.4.0a4-py3-none-win_amd64.whl |
|---|---|
| Size | 29.4 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
cbd509218b4b17f75ee7841f9c21d5cacc1626d3b823a652a6627dbad18228ec
|
|
BLAKE2b-256 checksum How to use checksums |
77fccb203ae648ce1c14954f4752601fb0bf2dd2f627e0e62e4e7aa68b1dc9ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.6
|
Release files / nodejs_bin-18.4.0a4-py3-none-win32.whl
| Download URL | nodejs_bin-18.4.0a4-py3-none-win32.whl |
|---|---|
| Size | 27.5 MB |
| Tags | Python 3 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
59671fdc563dabb8be8a0b6dae4169d780482b3c9e0fba3f9aa2b7ee8d2261ac
|
|
BLAKE2b-256 checksum How to use checksums |
367c9873a1a5d64179513240380474086bc69de72ef3ac27aa00210961d4742b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.6
|
Release files / nodejs_bin-18.4.0a4-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
| Download URL | nodejs_bin-18.4.0a4-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl |
|---|---|
| Size | 44.1 MB |
| Tags | Linux glibc 2.17+ ARMv7l Python 3 |
|
SHA-256 checksum How to use checksums |
21f1f77ddc8fe05353bb6d6ee8e5a62edb3a8dcdb2740a5f9307fd8d9eef6691
|
|
BLAKE2b-256 checksum How to use checksums |
2004045acf6f5a051f8088619728f822dcbf2af47cfc01ccadf57db672cd547e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.6
|
Release files / nodejs_bin-18.4.0a4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | nodejs_bin-18.4.0a4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 47.1 MB |
| Tags | Linux glibc 2.17+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
431ee3529f4fb226ddcfd4f14cb37e7df31238c42dfd051f4bf8f0c21029b133
|
|
BLAKE2b-256 checksum How to use checksums |
df663a8ae9dde45b2181d9dbfc33dedbefc8c530fb833d90410efb28179af7a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.6
|
Release files / nodejs_bin-18.4.0a4-py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
| Download URL | nodejs_bin-18.4.0a4-py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl |
|---|---|
| Size | 47.3 MB |
| Tags | Linux glibc 2.12+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
06cfeaa4d26eec94d8edb9927525ce94eb96dadc81f7d1daed42d1a7d003a4c9
|
|
BLAKE2b-256 checksum How to use checksums |
14f5b85f10ddb2b6bf58395bd08a7794ded91518f7eca1dc771c22c808c44e81
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.6
|
Release files / nodejs_bin-18.4.0a4-py3-none-macosx_11_0_arm64.whl
| Download URL | nodejs_bin-18.4.0a4-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 43.3 MB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
068ca987ed83ea1123775fafe5dc22d8f2ff920d7d31571e1bfe6fb1093833eb
|
|
BLAKE2b-256 checksum How to use checksums |
36217bb412b4418385e3d572311b567bfeac3009a24df2e097c1c1c427404a19
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.6
|
Release files / nodejs_bin-18.4.0a4-py3-none-macosx_10_9_x86_64.whl
| Download URL | nodejs_bin-18.4.0a4-py3-none-macosx_10_9_x86_64.whl |
|---|---|
| Size | 44.9 MB |
| Tags | Python 3 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
16cb1abf7fe8c11c574e1e474d9f934a0df49a480290eae6e733d8bb09512e22
|
|
BLAKE2b-256 checksum How to use checksums |
f0a9c679333eb93df04d5d8d005edaeb77013c2b851b30fe30af6f8743c56be4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.6
|
Security for nodejs-bin 18.4.0a4
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.