nodejs-bin


Namenodejs-bin JSON
Version 18.4.0a4 PyPI version JSON
download
home_page
SummaryNode.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.
upload_time2022-07-06 22:12:13
maintainer
docs_urlNone
author
requires_python~=3.5
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Node.js PyPI distribution
=====================

[Node.js][nodejs] 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][pypi] 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](#command-line-usage) and a [Python API](#python-api-usage).

**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>.

[nodejs]: https://nodejs.org/
[pypi]: https://pypi.org/project/nodejs-bin/

Install
-------

To install:

```shell
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:

```shell
pip install 'nodejs-bin[cmd]'
```

You can specify the Node.js version to install with:

```shell
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:

```shell
python -m nodejs
```

`npm` and `npx` are also available as `nodejs.npm` and `nodejs.npx`:

```shell
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:

```shell
node
npm
npx
```

Python API Usage
----------------

`node-bin` has a simple Python API that wraps the Node.js command line with the [Python `subprocess`](https://docs.python.org/3/library/subprocess.html).

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:

```python
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()`](https://docs.python.org/3/library/subprocess.html#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](https://docs.python.org/3/library/subprocess.html#subprocess.CompletedProcess) object:

```python
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()`](https://docs.python.org/3/library/subprocess.html#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:

```python
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()`](https://docs.python.org/3/library/subprocess.html#subprocess.Popen), passes though all `kwargs` and returns a [`Popen` object](https://docs.python.org/3/library/subprocess.html#popen-objects).

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](https://nodejs.org/en/about/releases/) 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](https://raw.githubusercontent.com/nodejs/node/master/LICENSE).
            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "nodejs-bin",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "~=3.5",
    "maintainer_email": "",
    "keywords": "",
    "author": "",
    "author_email": "",
    "download_url": "",
    "platform": null,
    "description": "Node.js PyPI distribution\n=====================\n\n[Node.js][nodejs] 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. \n\nThe [nodejs-bin][pypi] 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](#command-line-usage) and a [Python API](#python-api-usage).\n\n**Note: this is an unofficial Node.js distribution.**\n\n**This is intended for use within Python virtual environments and containers, it should probably not be used for global installation.**\n\nThis PyPI distribution is provided by <https://github.com/samwillis/nodejs-pypi>.\n\n[nodejs]: https://nodejs.org/\n[pypi]: https://pypi.org/project/nodejs-bin/\n\nInstall\n-------\n\nTo install:\n\n```shell\npip install nodejs-bin\n```\n\nBy default the command line `node`, `npm` and `npx` commands are not installed to prevent collisions with already installed Node.js versions. To install them:\n\n```shell\npip install 'nodejs-bin[cmd]'\n```\n\nYou can specify the Node.js version to install with:\n\n```shell\npip install nodejs-bin==<version>\n\n# Example:\npip install nodejs-bin==16.15.1\n```\n\nCommand Line Usage\n------------------\n\nTo run Node.js from the command line, use:\n\n```shell\npython -m nodejs\n```\n\n`npm` and `npx` are also available as `nodejs.npm` and `nodejs.npx`:\n\n```shell\npython -m nodejs.npm\npython -m nodejs.npx\n```\n\nIf 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:\n\n```shell\nnode\nnpm\nnpx\n```\n\nPython API Usage\n----------------\n\n`node-bin` has a simple Python API that wraps the Node.js command line with the [Python `subprocess`](https://docs.python.org/3/library/subprocess.html).\n\nFor `node`, `npm` and `npx` there are `.call()`, `.run()` and `.Popen()` methods that match the equivalent `subprocess` methods.\n\nTo run Node.js from a Python program and return the exit code:\n\n```python\nfrom nodejs import node, npm, npx\n\n# Run Node.js and return the exit code.\nnode.call(['script.js', 'arg1', ...], **kwargs)\n\n# Run npm and return the exit code.\nnpm.call(['command', 'arg1', ...], **kwargs)\n\n# Run npx and return the exit code.\nnpx.call(['command', 'arg1', ...], **kwargs)\n```\n\nThe `call(args, **kwargs)` functions wrap [`subprocess.call()`](https://docs.python.org/3/library/subprocess.html#subprocess.call), passes though all `kwargs` and returns the exit code of the process.\n\nTo run Node.js from a Python program and return a [CompletedProcess](https://docs.python.org/3/library/subprocess.html#subprocess.CompletedProcess) object:\n\n```python\nfrom nodejs import node, npm, npx\n\n# Run Node.js and return the exit code.\nnode.run(['script.js', 'arg1', ...], **kwargs)\n\n# Run npm and return the exit code.\nnpm.run(['command', 'arg1', ...], **kwargs)\n\n# Run npx and return the exit code.\nnpx.run(['command', 'arg1', ...], **kwargs)\n```\n\nThe `run(args, **kwargs)` functions wrap [`subprocess.run()`](https://docs.python.org/3/library/subprocess.html#subprocess.run), passes though all `kwargs` and returns a `CompletedProcess`.\n\nAdditionally, to start a Node.js process and return a `subprocess.Popen` object, you can use the `Popen(args, **kwargs)` functions:\n\n```python\nfrom nodejs import node, npm, npx\n\n# Start Node.js and return the Popen object.\nnode_process = node.Popen(['script.js', 'arg1', ...], **kwargs)\n\n# Start npm and return the Popen object.\nnpm_process = npm.Popen(['command', 'arg1', ...], **kwargs)\n\n# Start npx and return the Popen object.\nnpx_process = npx.Popen(['command', 'arg1', ...], **kwargs)\n```\n\nThe `Popen(args, **kwargs)` functions wrap [`subprocess.Popen()`](https://docs.python.org/3/library/subprocess.html#subprocess.Popen), passes though all `kwargs` and returns a [`Popen` object](https://docs.python.org/3/library/subprocess.html#popen-objects).\n\nThe `nodejs.node` api is also available as `nodejs.run` and `nodejs.call` and `nodejs.Popen`.\n\nFinally, there are a number of convenient attributes on the `nodejs` module:\n\n  * `nodejs.node_version`: the version of Node.js that is installed.\n  * `nodejs.path`: the path to the Node.js executable.\n\n\nVersions\n--------\n\nnodejs-bin offers Node.js *Current* and *LTS* (long-term support) versions. See the [Node.js Documentation](https://nodejs.org/en/about/releases/) for more information.\n\nThe full list of versions is available on PyPI is here: <https://pypi.org/project/nodejs-bin/#history>\n\n\nLicense\n-------\n\nThe [Node.js license](https://raw.githubusercontent.com/nodejs/node/master/LICENSE).",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "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.",
    "version": "18.4.0a4",
    "project_urls": {
        "Node.js Homepage": "https://nodejs.org",
        "Project Homepage": "https://github.com/samwillis/nodejs-pypi"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f0a9c679333eb93df04d5d8d005edaeb77013c2b851b30fe30af6f8743c56be4",
                "md5": "3a9fce450e03febf915af096953901cf",
                "sha256": "16cb1abf7fe8c11c574e1e474d9f934a0df49a480290eae6e733d8bb09512e22"
            },
            "downloads": -1,
            "filename": "nodejs_bin-18.4.0a4-py3-none-macosx_10_9_x86_64.whl",
            "has_sig": false,
            "md5_digest": "3a9fce450e03febf915af096953901cf",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "~=3.5",
            "size": 44913825,
            "upload_time": "2022-07-06T22:12:13",
            "upload_time_iso_8601": "2022-07-06T22:12:13.636528Z",
            "url": "https://files.pythonhosted.org/packages/f0/a9/c679333eb93df04d5d8d005edaeb77013c2b851b30fe30af6f8743c56be4/nodejs_bin-18.4.0a4-py3-none-macosx_10_9_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "36217bb412b4418385e3d572311b567bfeac3009a24df2e097c1c1c427404a19",
                "md5": "7bc8a02f4cb3f9890382d5ec208a1eaf",
                "sha256": "068ca987ed83ea1123775fafe5dc22d8f2ff920d7d31571e1bfe6fb1093833eb"
            },
            "downloads": -1,
            "filename": "nodejs_bin-18.4.0a4-py3-none-macosx_11_0_arm64.whl",
            "has_sig": false,
            "md5_digest": "7bc8a02f4cb3f9890382d5ec208a1eaf",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "~=3.5",
            "size": 43294781,
            "upload_time": "2022-07-06T22:12:44",
            "upload_time_iso_8601": "2022-07-06T22:12:44.605743Z",
            "url": "https://files.pythonhosted.org/packages/36/21/7bb412b4418385e3d572311b567bfeac3009a24df2e097c1c1c427404a19/nodejs_bin-18.4.0a4-py3-none-macosx_11_0_arm64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "14f5b85f10ddb2b6bf58395bd08a7794ded91518f7eca1dc771c22c808c44e81",
                "md5": "fbdd37bcaa55befe9793a87bc592478d",
                "sha256": "06cfeaa4d26eec94d8edb9927525ce94eb96dadc81f7d1daed42d1a7d003a4c9"
            },
            "downloads": -1,
            "filename": "nodejs_bin-18.4.0a4-py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl",
            "has_sig": false,
            "md5_digest": "fbdd37bcaa55befe9793a87bc592478d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "~=3.5",
            "size": 47303948,
            "upload_time": "2022-07-06T22:13:22",
            "upload_time_iso_8601": "2022-07-06T22:13:22.033879Z",
            "url": "https://files.pythonhosted.org/packages/14/f5/b85f10ddb2b6bf58395bd08a7794ded91518f7eca1dc771c22c808c44e81/nodejs_bin-18.4.0a4-py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "df663a8ae9dde45b2181d9dbfc33dedbefc8c530fb833d90410efb28179af7a5",
                "md5": "63e7ee9f248cd377ca50c8d42399f210",
                "sha256": "431ee3529f4fb226ddcfd4f14cb37e7df31238c42dfd051f4bf8f0c21029b133"
            },
            "downloads": -1,
            "filename": "nodejs_bin-18.4.0a4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
            "has_sig": false,
            "md5_digest": "63e7ee9f248cd377ca50c8d42399f210",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "~=3.5",
            "size": 47142342,
            "upload_time": "2022-07-06T22:13:53",
            "upload_time_iso_8601": "2022-07-06T22:13:53.799664Z",
            "url": "https://files.pythonhosted.org/packages/df/66/3a8ae9dde45b2181d9dbfc33dedbefc8c530fb833d90410efb28179af7a5/nodejs_bin-18.4.0a4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2004045acf6f5a051f8088619728f822dcbf2af47cfc01ccadf57db672cd547e",
                "md5": "e9e3c9dd0a7277e8ed26be92d326b33e",
                "sha256": "21f1f77ddc8fe05353bb6d6ee8e5a62edb3a8dcdb2740a5f9307fd8d9eef6691"
            },
            "downloads": -1,
            "filename": "nodejs_bin-18.4.0a4-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl",
            "has_sig": false,
            "md5_digest": "e9e3c9dd0a7277e8ed26be92d326b33e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "~=3.5",
            "size": 44112196,
            "upload_time": "2022-07-06T22:14:30",
            "upload_time_iso_8601": "2022-07-06T22:14:30.475971Z",
            "url": "https://files.pythonhosted.org/packages/20/04/045acf6f5a051f8088619728f822dcbf2af47cfc01ccadf57db672cd547e/nodejs_bin-18.4.0a4-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "367c9873a1a5d64179513240380474086bc69de72ef3ac27aa00210961d4742b",
                "md5": "9d31b4d796e8add482a780764e55ef3d",
                "sha256": "59671fdc563dabb8be8a0b6dae4169d780482b3c9e0fba3f9aa2b7ee8d2261ac"
            },
            "downloads": -1,
            "filename": "nodejs_bin-18.4.0a4-py3-none-win32.whl",
            "has_sig": false,
            "md5_digest": "9d31b4d796e8add482a780764e55ef3d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "~=3.5",
            "size": 27509663,
            "upload_time": "2022-07-06T22:14:52",
            "upload_time_iso_8601": "2022-07-06T22:14:52.882188Z",
            "url": "https://files.pythonhosted.org/packages/36/7c/9873a1a5d64179513240380474086bc69de72ef3ac27aa00210961d4742b/nodejs_bin-18.4.0a4-py3-none-win32.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "77fccb203ae648ce1c14954f4752601fb0bf2dd2f627e0e62e4e7aa68b1dc9ac",
                "md5": "5ee3bb3b58b1cfc7618432f3ebd5f3ff",
                "sha256": "cbd509218b4b17f75ee7841f9c21d5cacc1626d3b823a652a6627dbad18228ec"
            },
            "downloads": -1,
            "filename": "nodejs_bin-18.4.0a4-py3-none-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "5ee3bb3b58b1cfc7618432f3ebd5f3ff",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "~=3.5",
            "size": 29356349,
            "upload_time": "2022-07-06T22:15:14",
            "upload_time_iso_8601": "2022-07-06T22:15:14.233679Z",
            "url": "https://files.pythonhosted.org/packages/77/fc/cb203ae648ce1c14954f4752601fb0bf2dd2f627e0e62e4e7aa68b1dc9ac/nodejs_bin-18.4.0a4-py3-none-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-07-06 22:12:13",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "samwillis",
    "github_project": "nodejs-pypi",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "nodejs-bin"
}
        
Elapsed time: 0.30658s