# Path: django_node/exceptions.py
# class NpmInstallArgumentsError(Exception):
#     pass
# 
# Path: django_node/settings.py
# PATH_TO_NPM = setting_overrides.get(
#     'PATH_TO_NPM',
#     'npm'
# )
# 
# NPM_INSTALL_PATH_TO_PYTHON = setting_overrides.get(
#     'NPM_INSTALL_PATH_TO_PYTHON',
#     None,
# )
# 
# NPM_INSTALL_COMMAND = setting_overrides.get(
#     'NPM_INSTALL_COMMAND',
#     'install',
# )
# 
# 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
import subprocess
from .exceptions import NpmInstallArgumentsError
from .settings import PATH_TO_NPM, NPM_INSTALL_PATH_TO_PYTHON, NPM_INSTALL_COMMAND
from .utils import (
    NPM_NAME, npm_installed, npm_version, npm_version_raw, raise_if_dependency_missing,
    raise_if_dependency_version_less_than, run_command
)

is_installed = npm_installed
version = npm_version
version_raw = npm_version_raw


def ensure_installed():
    raise_if_dependency_missing(NPM_NAME)


def ensure_version_gte(required_version):
    ensure_installed()

# Path: django_node/exceptions.py
# class NpmInstallArgumentsError(Exception):
#     pass
# 
# Path: django_node/settings.py
# PATH_TO_NPM = setting_overrides.get(
#     'PATH_TO_NPM',
#     'npm'
# )
# 
# NPM_INSTALL_PATH_TO_PYTHON = setting_overrides.get(
#     'NPM_INSTALL_PATH_TO_PYTHON',
#     None,
# )
# 
# NPM_INSTALL_COMMAND = setting_overrides.get(
#     'NPM_INSTALL_COMMAND',
#     'install',
# )
# 
# 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/npm.py
import os
import subprocess
from .exceptions import NpmInstallArgumentsError
from .settings import PATH_TO_NPM, NPM_INSTALL_PATH_TO_PYTHON, NPM_INSTALL_COMMAND
from .utils import (
    NPM_NAME, npm_installed, npm_version, npm_version_raw, raise_if_dependency_missing,
    raise_if_dependency_version_less_than, run_command
)


is_installed = npm_installed
version = npm_version
version_raw = npm_version_raw


def ensure_installed():
    raise_if_dependency_missing(NPM_NAME)


def ensure_version_gte(required_version):
    ensure_installed()

    raise_if_dependency_version_less_than(NPM_NAME, required_version)