Node.js virtual environment builder for creating isolated Node.js environments
80
A library that determines the correct Node.js binary download URL and package name based on system architecture and platform information.
@generates
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
"""
passProvides Node.js virtual environment management and architecture detection capabilities.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/pypi-nodeenvdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10