0
# SWC Core Linux x64 Musl
1
2
SWC Core Linux x64 Musl is a platform-specific native binary distribution containing the compiled Rust implementation of SWC (Speedy Web Compiler) optimized for Linux x64 systems with musl libc. This package provides no JavaScript API and serves exclusively as an optional dependency for the main `@swc/core` package.
3
4
## Package Information
5
6
- **Package Name**: @swc/core-linux-x64-musl
7
- **Package Type**: npm
8
- **Language**: Native binary (compiled from Rust)
9
- **Installation**: Automatically installed as optional dependency of `@swc/core`
10
- **Target Platform**: Linux x64 systems with musl libc (Alpine Linux, etc.)
11
12
## Core Imports
13
14
This package exports no JavaScript API. All SWC functionality is accessed through the main `@swc/core` package:
15
16
```typescript
17
import { transform, transformSync, parse, parseSync } from "@swc/core";
18
```
19
20
For CommonJS:
21
22
```javascript
23
const { transform, transformSync, parse, parseSync } = require("@swc/core");
24
```
25
26
## Basic Usage
27
28
This package cannot be used directly. It is consumed automatically by `@swc/core` when running on compatible Linux musl systems:
29
30
```typescript
31
// This uses @swc/core, which automatically loads the musl binary when available
32
import { transform } from "@swc/core";
33
34
const result = await transform(`
35
const message: string = "Hello, World!";
36
console.log(message);
37
`, {
38
filename: "example.ts",
39
jsc: {
40
parser: {
41
syntax: "typescript",
42
},
43
target: "es2018",
44
},
45
module: {
46
type: "commonjs",
47
},
48
});
49
```
50
51
## Architecture
52
53
This package contains only a single compiled native binary file:
54
55
- **swc.linux-x64-musl.node**: The compiled SWC Rust implementation optimized for Linux x64 musl systems
56
- **Native Binary Loading**: Automatically loaded by `@swc/core` when running on compatible systems
57
- **Platform Detection**: Used only when `process.platform === 'linux'` and musl libc is detected
58
- **Optional Dependency**: Installed alongside other platform binaries but only loaded when appropriate
59
60
## Capabilities
61
62
### Native Binary Distribution
63
64
This package serves as a platform-specific native binary distribution for SWC's core functionality.
65
66
```typescript { .api }
67
// No direct API - this package provides only the compiled binary
68
// All functionality is accessed through @swc/core
69
```
70
71
**Key characteristics:**
72
73
- Contains compiled Rust code optimized for Linux x64 musl systems
74
- Provides no JavaScript exports or TypeScript definitions
75
- Automatically detected and loaded by the main `@swc/core` package
76
- Enables high-performance compilation on Alpine Linux and similar musl-based systems
77
- Part of SWC's multi-platform binary distribution strategy
78
79
## Installation and Usage
80
81
This package is automatically installed when installing `@swc/core` on compatible systems. No direct interaction is required:
82
83
```bash
84
# Installing @swc/core will automatically include platform-specific binaries
85
npm install @swc/core
86
87
# The musl binary is automatically used when running on compatible systems
88
# No additional configuration needed
89
```
90
91
## Platform Compatibility
92
93
- **Operating System**: Linux
94
- **Architecture**: x64 (x86_64)
95
- **C Library**: musl libc
96
- **Common Distributions**: Alpine Linux, Void Linux, OpenWrt
97
- **Container Usage**: Ideal for Alpine-based Docker containers
98
99
## Technical Details
100
101
- **Binary Name**: `swc.linux-x64-musl.node`
102
- **Format**: Node.js native addon (.node file)
103
- **Loading**: Automatic via `@swc/core`'s platform detection
104
- **Performance**: Optimized for musl libc systems
105
- **Dependencies**: None (self-contained binary)