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

Cross-Platform Node.js Environment Setup Tool

Build a Python command-line tool that creates isolated Node.js environments on different platforms and architectures. The tool should automatically detect the system's platform and create an appropriate Node.js environment.

Requirements

Platform Detection

Detect the current operating system and processor architecture to determine the correct Node.js binaries to use.

Environment Creation

Create an isolated Node.js environment in a target directory with proper directory structure for the detected platform.

Activation Scripts

Generate shell activation scripts appropriate for the detected platform (bash for Unix-like systems, PowerShell for Windows).

Implementation

@generates

API

def setup_environment(target_dir: str, node_version: str = 'latest') -> None:
    """
    Create a Node.js virtual environment in the target directory.

    Args:
        target_dir: Directory path where the environment will be created
        node_version: Node.js version ('latest' or specific version like '20.0.0')

    Raises:
        RuntimeError: If environment creation fails
    """
    pass

Test Cases

  • Calling setup_environment('/tmp/nodeenv1', 'latest') creates a directory at /tmp/nodeenv1 @test
  • After calling setup_environment('/tmp/nodeenv2', 'latest'), the directory contains a bin/ subdirectory on Unix or Scripts/ on Windows @test
  • After calling setup_environment('/tmp/nodeenv3', '20.0.0'), running the node binary in the environment reports version 20.0.0 @test
  • After calling setup_environment('/tmp/nodeenv4', 'latest'), an activation script exists (activate or activate.ps1) in the appropriate directory @test

Dependencies { .dependencies }

nodeenv { .dependency }

Provides Node.js virtual environment creation and management capabilities with cross-platform support.

Version

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