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-5/

Node.js Environment Management Tool

Build a Python tool that automates the setup of isolated Node.js development environments with package dependency management.

Requirements

Your tool must implement the following functionality:

Environment Setup

Create a function that sets up a new isolated Node.js environment in a specified directory. The environment should:

  • Install a specific version of Node.js (or the latest version if not specified)
  • Be completely isolated from other Node.js installations on the system
  • Support installation of npm packages from a requirements file

Package Management

Implement functionality to:

  • Install npm packages listed in a requirements file (one package specification per line, e.g., express@4.18.0)
  • Export currently installed packages to a requirements file in a format that can be reinstalled later
  • Support both global and local package listings when exporting

Environment Updates

Provide a way to update packages in an existing environment from a requirements file without recreating the entire environment.

Test Cases

  • Creating an environment with Node.js version 18.17.0 installs that specific version @test
  • Installing packages from a requirements file containing express@4.18.0 and lodash@4.17.21 successfully installs both packages @test
  • Exporting installed packages produces a requirements file with correct package names and versions @test
  • Updating an existing environment with a new requirements file installs the new packages without reinstalling Node.js @test

API

def setup_environment(env_dir: str, node_version: str = 'latest', requirements_file: str = None) -> None:
    """
    Create an isolated Node.js environment.

    Args:
        env_dir: Directory path where the environment will be created
        node_version: Node.js version to install (default: 'latest')
        requirements_file: Optional path to requirements file for package installation
    """
    pass

def export_packages(env_dir: str, output_file: str, local_only: bool = False) -> None:
    """
    Export installed packages to a requirements file.

    Args:
        env_dir: Directory path of the Node.js environment
        output_file: Path to output requirements file
        local_only: If True, only export locally installed packages
    """
    pass

def update_packages(env_dir: str, requirements_file: str) -> None:
    """
    Update packages in an existing environment from a requirements file.

    Args:
        env_dir: Directory path of the existing Node.js environment
        requirements_file: Path to requirements file with package specifications
    """
    pass

Implementation

@generates

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