CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/pypi-nodeenv

tessl install tessl/pypi-nodeenv@1.9.0

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

Agent Success

Agent success rate when using this tile

80%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.25x

Baseline

Agent success rate without this tile

64%

task.mdevals/scenario-7/

Node Environment Manager with Custom Download Configuration

A Python script that creates Node.js virtual environments with configurable network resilience settings for unreliable or restricted network conditions.

Requirements

Core Functionality

Your script must create Node.js virtual environments with support for custom network configurations. The script should handle scenarios where network connections are unreliable or where corporate firewalls and proxies restrict access to standard Node.js download sources.

Command-Line Interface

Create a Python script setup_node_env.py that accepts the following command-line arguments:

  • --env-dir DIR - Directory path where the Node.js environment should be created (required)
  • --node-version VERSION - Node.js version to install (e.g., "18.0.0", "latest", "lts")
  • --mirror URL - Alternative mirror URL for downloading Node.js packages
  • --ignore-ssl - Flag to bypass SSL certificate verification (for corporate proxies)
  • --requirements FILE - Path to a requirements file containing npm packages to install

Network Resilience

The script must properly configure the environment creation to:

  1. Support alternative download mirrors when the default source is unavailable
  2. Handle SSL certificate issues that occur in corporate environments
  3. Support installation of npm packages from a requirements file after environment creation

Test Cases

  • Creates a Node.js environment in the specified directory with the latest version when no version is specified @test
  • Creates a Node.js environment with a specific version (e.g., "18.0.0") when version is provided @test
  • Successfully uses a custom mirror URL for downloading Node.js packages @test
  • Bypasses SSL certificate verification when the --ignore-ssl flag is set @test

Implementation

@generates

API

#!/usr/bin/env python
"""
Node environment setup script with network resilience features.
"""

import argparse
import sys

def parse_arguments():
    """
    Parse command-line arguments for environment setup.

    Returns:
        argparse.Namespace: Parsed arguments
    """
    pass

def create_node_environment(env_dir, node_version=None, mirror=None,
                           ignore_ssl=False, requirements=None):
    """
    Create a Node.js virtual environment with custom network settings.

    Args:
        env_dir (str): Directory path for the environment
        node_version (str): Node.js version to install
        mirror (str): Alternative mirror URL
        ignore_ssl (bool): Whether to ignore SSL certificate verification
        requirements (str): Path to npm requirements file

    Returns:
        bool: True if successful, False otherwise
    """
    pass

def main():
    """
    Main entry point for the script.
    """
    pass

if __name__ == "__main__":
    main()

Dependencies { .dependencies }

nodeenv { .dependency }

Provides Node.js virtual environment creation and management capabilities.

@satisfied-by

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/nodeenv@1.9.x
tile.json