or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

index.md
tile.json

tessl/npm-swc--core-darwin-arm64

Platform-specific native binary for SWC TypeScript/JavaScript compiler on macOS ARM64 architecture

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/@swc/core-darwin-arm64@1.13.x

To install, run

npx @tessl/cli install tessl/npm-swc--core-darwin-arm64@1.13.0

index.mddocs/

@swc/core-darwin-arm64

@swc/core-darwin-arm64 is a platform-specific native binary package that provides the macOS ARM64 (Apple Silicon) native Node.js addon for SWC (Speedy Web Compiler). This package contains only the compiled native binary (swc.darwin-arm64.node) and does not provide any direct JavaScript API. It is automatically loaded by the main @swc/core package when running on compatible systems.

Package Information

  • Package Name: @swc/core-darwin-arm64
  • Package Type: npm
  • Language: Rust (native binary)
  • Installation: Automatically installed as an optional dependency of @swc/core
  • Platform: macOS (darwin), ARM64 (Apple Silicon)
  • Node.js: Version 10 or higher
  • Binary File: swc.darwin-arm64.node

Core Imports

This package does not provide any direct JavaScript imports or API. The native binary is automatically loaded by the main @swc/core package:

// @swc/core automatically loads the platform-specific binary
const swc = require("@swc/core");

For TypeScript:

import * as swc from "@swc/core";

Basic Usage

Since this is a platform-specific binary package with no API surface, you interact with SWC functionality through the main @swc/core package:

import { transform } from "@swc/core";

// The darwin-arm64 binary is automatically used for the transformation
const result = await transform("const x: number = 1;", {
  jsc: {
    parser: {
      syntax: "typescript",
    },
    target: "es2018",
  },
  module: {
    type: "commonjs",
  },
});

console.log(result.code); // Transformed JavaScript

Architecture

@swc/core-darwin-arm64 is part of SWC's multi-platform distribution strategy:

  • Native Binary: Contains only swc.darwin-arm64.node, a compiled Rust binary providing optimal performance
  • Platform Detection: The main @swc/core package automatically detects the platform and loads the appropriate binary
  • Fallback Support: If the native binary fails to load, @swc/core falls back to a WebAssembly version
  • NAPI Integration: Uses Node.js N-API for stable binary interface across Node.js versions
  • Optional Dependency: Installed as an optional dependency by @swc/core based on the target platform

Capabilities

Native Binary Provision

The sole capability of this package is to provide the underlying native implementation that powers all SWC transformation operations on macOS ARM64 systems.

// This package provides no JavaScript API
// Binary file: swc.darwin-arm64.node
// Automatically loaded by @swc/core when available

The package contains only the native binary file and does not export any JavaScript functions or interfaces. All SWC functionality is accessed through the main @swc/core package, which dynamically loads this binary when running on compatible systems.

Platform Requirements

  • Operating System: macOS (darwin)
  • Architecture: ARM64 (Apple Silicon: M1, M2, M3, M4 processors)
  • Node.js: Version 10 or higher
  • Dependencies: None (this package contains only the binary file)

Installation Notes

This package is automatically installed as an optional dependency by @swc/core and should not be installed manually:

# Correct installation - this automatically installs the platform-specific binary
npm install @swc/core

Manual installation is unnecessary and not recommended:

# Not recommended - the binary is automatically managed
npm install @swc/core-darwin-arm64

Troubleshooting

Binary Loading Issues

If the native binary fails to load, @swc/core automatically falls back to the WebAssembly version (@swc/wasm) with reduced performance. Common issues include:

  • Architecture mismatch: Using x64 Node.js on ARM64 system or vice versa
  • Node.js version: Unsupported Node.js version (< 10)
  • Binary corruption: Re-installing @swc/core typically resolves this
  • Missing native binary: Package may not have been installed correctly

Platform Detection

You can verify which binary is being used:

import { getBinaryMetadata } from "@swc/core";

console.log(getBinaryMetadata());
// Expected output on ARM64 macOS: { target: "aarch64-apple-darwin" }

Performance Characteristics

The native binary provides significant performance advantages over JavaScript alternatives when successfully loaded:

  • Parsing: 20x faster than TypeScript compiler
  • Transformation: 20x faster than Babel
  • Minification: Comparable to Terser with better performance
  • Memory Usage: Lower memory footprint due to Rust implementation
  • Multi-threading: Utilizes multiple CPU cores for large codebases

Related Packages

  • @swc/core: Main package providing the JavaScript API
  • @swc/wasm: WebAssembly fallback when native binary is unavailable
  • Other platform binaries: @swc/core-darwin-x64, @swc/core-linux-x64-gnu, @swc/core-win32-x64-msvc, etc.