Skip to content
[UNMAINTAINED]
Branch: master
Clone or download

README.md

python-nodejs

Build Status

Python bindings and utils for Node.js and io.js.

from nodejs.bindings import node_run

stderr, stdout = node_run('/path/to/some/file.js', '--some-argument')

Installation

pip install nodejs

Bindings

nodejs.bindings.node_run()

Invokes Node with the arguments provided and return the resulting stderr and stdout.

from nodejs.bindings import node_run

stderr, stdout = node_run('/path/to/some/file.js', '--some-argument')

nodejs.bindings.ensure_installed()

Raises an exception if node is not installed.

nodejs.bindings.ensure_version_gte()

Raises an exception if the installed version of node is less than the version required.

Arguments:

version_required: a tuple containing the minimum version required.

from nodejs.bindings import ensure_node_version_gte

ensure_node_version_gte((0, 10, 0,))

nodejs.bindings.is_installed

A boolean indicating if Node is installed.

nodejs.bindings.version

A tuple containing the version of Node installed. For example, (0, 10, 33)

nodejs.bindings.version_raw

A string containing the raw version returned from Node. For example, 'v0.10.33'

Running the tests

mkvirtualenv python-nodejs
pip install -r requirements.txt
nosetests
You can’t perform that action at this time.