The django_node.node
module provides utils for introspecting and calling Node.
Methods
Attributes
Invokes Node with the arguments provided and return the resulting stderr and stdout.
Accepts an optional keyword argument, production
, which will ensure that the command is run
with the NODE_ENV
environment variable set to 'production'.
from django_node import node
stderr, stdout = node.run('/path/to/some/file.js', '--some-argument')
# With NODE_ENV set to production
stderr, stdout = node.run('/path/to/some/file.js', '--some-argument', production=True)
Raises an exception if Node is not installed.
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 django_node import node
node.ensure_version_gte((0, 10, 0,))
A boolean indicating if Node is installed.
A tuple containing the version of Node installed. For example, (0, 10, 33)
A string containing the raw version returned from Node. For example, 'v0.10.33'