CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-nodeenv

Node.js virtual environment builder for creating isolated Node.js environments

80

1.25x
Overview
Eval results
Files

cli.mddocs/

Command Line Interface

Main entry point and command-line argument processing for the nodeenv tool. Provides comprehensive argument parsing, configuration loading, and orchestration of environment creation operations.

Capabilities

Main Entry Point

Primary entry point for the nodeenv command-line tool that handles argument parsing, configuration loading, and orchestrates the entire environment creation process.

def main():
    """
    Entry point for nodeenv command-line tool.
    
    Processes command-line arguments, loads configuration, and creates
    Node.js virtual environments based on provided options.
    
    Handles special cases like --dump-config-defaults and manages
    global settings for SSL certificates and mirror URLs.
    """

Usage examples:

import nodeenv
import sys

# Create environment with specific Node.js version
sys.argv = ['nodeenv', '--node=16.20.0', 'myenv']
nodeenv.main()

# Create environment with npm and custom jobs
sys.argv = ['nodeenv', '--with-npm', '--jobs=4', 'myenv']
nodeenv.main()

# List available Node.js versions
sys.argv = ['nodeenv', '--list']
nodeenv.main()

Argument Parser Creation

Creates and configures the argument parser with all available command-line options for nodeenv.

def make_parser():
    """
    Create argument parser for nodeenv command-line interface.
    
    Returns:
    argparse.ArgumentParser: Configured parser with all nodeenv options
    
    Includes options for:
    - Node.js version selection
    - npm configuration  
    - Environment path and naming
    - Build options (jobs, SSL, source vs prebuilt)
    - Mirror and proxy settings
    - Integration with Python virtualenv
    """

Argument Parsing

Parses command-line arguments and validates them according to nodeenv requirements.

def parse_args(check=True):
    """
    Parse command-line arguments for nodeenv.
    
    Parameters:
    check (bool): Whether to perform validation checks on arguments
    
    Returns:
    argparse.Namespace: Parsed arguments object
    
    Validates argument combinations and sets up proper defaults
    based on the current environment and configuration.
    """

Logger Creation

Creates and configures logging for nodeenv operations with appropriate verbosity levels.

def create_logger():
    """
    Create logger instance for nodeenv operations.
    
    Returns:
    logging.Logger: Configured logger instance
    
    Sets up logging with appropriate formatters and handlers
    for console output during environment creation and management.
    """

Install with Tessl CLI

npx tessl i tessl/pypi-nodeenv

docs

cli.md

configuration.md

environment.md

index.md

node-install.md

package-management.md

utilities.md

version-management.md

tile.json