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

Platform Binary Selector

A library that determines the correct Node.js binary download URL and package name based on system architecture and platform information.

Capabilities

Platform Detection

  • On Linux x86_64 system, returns "linux-x64" as the platform string @test
  • On macOS ARM64 system, returns "darwin-arm64" as the platform string @test
  • On Windows x86 system, returns "win-x86" as the platform string @test

Architecture Mapping

  • Maps "amd64" machine type to "x64" architecture @test
  • Maps "armv7l" machine type to "armv7l" architecture @test
  • Maps "aarch64" machine type to "arm64" architecture @test
  • Handles case-insensitive machine identifiers (e.g., "AMD64" -> "x64") @test

Binary URL Construction

  • Constructs download URL for Node.js v18.0.0 on linux-x64 as "https://nodejs.org/dist/v18.0.0/node-v18.0.0-linux-x64.tar.gz" @test
  • Constructs download URL for Node.js v20.5.0 on darwin-arm64 as "https://nodejs.org/dist/v20.5.0/node-v20.5.0-darwin-arm64.tar.gz" @test

ARM64 Fallback Mechanism

  • When ARM64 binary is unavailable for a specific version, falls back to x64 architecture @test
  • Returns x64 URL when ARM64 is not supported for the platform @test

Implementation

@generates

API

def get_platform_string(system: str, machine: str) -> str:
    """
    Returns the platform string for Node.js binary selection.

    Args:
        system: Operating system name (e.g., 'Linux', 'Darwin', 'Windows')
        machine: Machine architecture (e.g., 'x86_64', 'arm64', 'i686')

    Returns:
        Platform string in format 'system-arch' (e.g., 'linux-x64', 'darwin-arm64')
    """
    pass

def map_architecture(machine: str) -> str:
    """
    Maps machine architecture identifier to Node.js architecture naming.
    Handles case-insensitive matching.

    Args:
        machine: Machine architecture identifier

    Returns:
        Normalized architecture string (e.g., 'x64', 'arm64', 'armv7l')
    """
    pass

def construct_binary_url(version: str, platform: str) -> str:
    """
    Constructs the download URL for a Node.js binary.

    Args:
        version: Node.js version string (e.g., 'v18.0.0')
        platform: Platform string (e.g., 'linux-x64')

    Returns:
        Complete download URL for the binary tarball
    """
    pass

def select_architecture_with_fallback(preferred_arch: str, available_architectures: list) -> str:
    """
    Selects architecture with fallback logic (e.g., ARM64 -> x64).

    Args:
        preferred_arch: Preferred architecture (e.g., 'arm64')
        available_architectures: List of available architectures for the version

    Returns:
        Selected architecture string, falling back to 'x64' if preferred unavailable
    """
    pass

Dependencies { .dependencies }

nodeenv { .dependency }

Provides Node.js virtual environment management and architecture detection capabilities.

@satisfied-by

Version

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