# Path: django_node/settings.py
# PATH_TO_NODE = setting_overrides.get(
#     'PATH_TO_NODE',
#     'node'
# )
# 
# Path: django_node/utils.py
# def run_command(cmd_to_run):
# def _interrogate(cmd_to_run, version_filter):
# def _validate_version_iterable(version):
# def _check_if_version_is_outdated(current_version, required_version):
# def _format_version(version):
# def raise_if_dependency_missing(application, required_version=None):
# def raise_if_dependency_version_less_than(application, required_version):
# def dynamic_import_module(import_path):
# def dynamic_import_attribute(import_path):
# def decode_html_entities(html):
# def convert_html_to_plain_text(html):
# def resolve_dependencies(node_version_required=None, npm_version_required=None, path_to_run_npm_install_in=None):
# def discover_services(service_config):
# NPM_NAME = 'NPM'
# NODE_NAME = 'Node.js'


import os
from .settings import PATH_TO_NODE
from .utils import (
    node_installed, node_version_raw, raise_if_dependency_missing, NODE_NAME, node_version,
    raise_if_dependency_version_less_than, run_command,
)

is_installed = node_installed
version = node_version
version_raw = node_version_raw


def ensure_installed():
    raise_if_dependency_missing(NODE_NAME)


def ensure_version_gte(required_version):
    ensure_installed()

# Path: django_node/settings.py
# PATH_TO_NODE = setting_overrides.get(
#     'PATH_TO_NODE',
#     'node'
# )
# 
# Path: django_node/utils.py
# def run_command(cmd_to_run):
# def _interrogate(cmd_to_run, version_filter):
# def _validate_version_iterable(version):
# def _check_if_version_is_outdated(current_version, required_version):
# def _format_version(version):
# def raise_if_dependency_missing(application, required_version=None):
# def raise_if_dependency_version_less_than(application, required_version):
# def dynamic_import_module(import_path):
# def dynamic_import_attribute(import_path):
# def decode_html_entities(html):
# def convert_html_to_plain_text(html):
# def resolve_dependencies(node_version_required=None, npm_version_required=None, path_to_run_npm_install_in=None):
# def discover_services(service_config):
# NPM_NAME = 'NPM'
# NODE_NAME = 'Node.js'


# Path: django_node/node.py
import os
from .settings import PATH_TO_NODE
from .utils import (
    node_installed, node_version_raw, raise_if_dependency_missing, NODE_NAME, node_version,
    raise_if_dependency_version_less_than, run_command,
)


is_installed = node_installed
version = node_version
version_raw = node_version_raw


def ensure_installed():
    raise_if_dependency_missing(NODE_NAME)


def ensure_version_gte(required_version):
    ensure_installed()

    raise_if_dependency_version_less_than(NODE_NAME, required_version)