0
# @swc/core-win32-ia32-msvc
1
2
@swc/core-win32-ia32-msvc is a platform-specific binary distribution package that provides the Windows 32-bit IA32 architecture native binaries for SWC (Speedy Web Compiler). This package contains compiled native code that enables high-performance JavaScript and TypeScript compilation on Windows 32-bit systems.
3
4
## Package Information
5
6
- **Package Name**: @swc/core-win32-ia32-msvc
7
- **Package Type**: npm
8
- **Language**: Native Binary (compiled from Rust)
9
- **Architecture**: i686-pc-windows-msvc (Windows 32-bit IA32)
10
- **Installation**: Automatically installed as a dependency of `@swc/core`
11
12
## Overview
13
14
This package is a binary distribution that contains no direct JavaScript API. Instead, it provides the native implementation that powers the SWC compiler functionality through the main `@swc/core` package. The package is automatically selected and loaded by `@swc/core` when running on Windows 32-bit IA32 architecture.
15
16
## Package Contents
17
18
The package contains two binary files:
19
20
- **swc.win32-ia32-msvc.node**: Native Node.js addon that provides the binding interface
21
- **swc.exe**: Standalone command-line executable for SWC operations
22
23
## Installation and Usage
24
25
This package is not intended to be installed directly. It is automatically installed as an optional dependency when installing `@swc/core` on Windows 32-bit IA32 systems.
26
27
```bash
28
# Install the main package (this binary package is included automatically)
29
npm install @swc/core
30
```
31
32
## Core Integration
33
34
The native binaries in this package are automatically loaded by `@swc/core` to provide the following functionality:
35
36
```typescript { .api }
37
// These APIs are provided by @swc/core using this binary package
38
import { transform, transformSync, parse, parseSync, minify, minifySync } from '@swc/core';
39
```
40
41
## Capabilities
42
43
### Native Binary Loading
44
45
Provides the native implementation for all SWC operations on Windows 32-bit IA32 architecture.
46
47
```typescript { .api }
48
// The binary is loaded automatically by @swc/core
49
const bindings = require('./swc.win32-ia32-msvc.node');
50
```
51
52
### Platform Detection
53
54
The package is conditionally loaded based on platform and architecture specifications.
55
56
```json { .api }
57
{
58
"os": ["win32"],
59
"cpu": ["ia32"]
60
}
61
```
62
63
### Node.js Addon Interface
64
65
The native addon exports the following low-level binding functions used by `@swc/core`:
66
67
```typescript { .api }
68
// Low-level binding functions (not for direct use)
69
interface NativeBindings {
70
transform(src: string, isModule: boolean, options: Buffer): TransformOutput;
71
transformSync(src: string, isModule: boolean, options: Buffer): TransformOutput;
72
transformFile(src: string, isModule: boolean, options: Buffer): Promise<TransformOutput>;
73
transformFileSync(src: string, isModule: boolean, options: Buffer): TransformOutput;
74
parse(src: string, options: Buffer, filename?: string): Promise<string>;
75
parseSync(src: string, options: Buffer, filename?: string): string;
76
parseFile(path: string, options: Buffer): Promise<string>;
77
parseFileSync(path: string, options: Buffer): string;
78
print(programJson: string, options: Buffer): Promise<TransformOutput>;
79
printSync(program: string, options: Buffer): TransformOutput;
80
minify(code: Buffer, opts: Buffer, isJson: boolean, extras: NapiMinifyExtra): Promise<TransformOutput>;
81
minifySync(code: Buffer, opts: Buffer, isJson: boolean, extras: NapiMinifyExtra): TransformOutput;
82
bundle(confItems: Buffer): Promise<{ [index: string]: { code: string, map?: string } }>;
83
analyze(src: string, options: Buffer): Promise<string>;
84
getTargetTriple(): string;
85
initCustomTraceSubscriber(traceOutFilePath?: string): void;
86
newMangleNameCache(): object;
87
}
88
89
interface TransformOutput {
90
code: string;
91
map?: string;
92
output?: string;
93
diagnostics: Array<string>;
94
}
95
96
interface NapiMinifyExtra {
97
mangleNameCache?: object;
98
}
99
```
100
101
### Command Line Executable
102
103
The included `swc.exe` provides direct command-line access to SWC functionality:
104
105
```bash
106
# Command-line usage (available when package is installed)
107
swc input.js -o output.js
108
swc --help
109
```
110
111
## Target Architecture
112
113
This package specifically targets the i686-pc-windows-msvc architecture:
114
115
- **Operating System**: Windows (win32)
116
- **Architecture**: 32-bit Intel/AMD (ia32)
117
- **Compiler Target**: MSVC (Microsoft Visual C++)
118
119
## Runtime Requirements
120
121
- **Node.js**: >= 10
122
- **Operating System**: Windows 32-bit
123
- **Architecture**: IA32 (Intel/AMD 32-bit)
124
125
## Binary Metadata
126
127
The native binding provides metadata about the loaded binary:
128
129
```typescript { .api }
130
// Metadata functions available through the native binding
131
interface BinaryMetadata {
132
getTargetTriple(): string; // Returns "i686-pc-windows-msvc"
133
}
134
```
135
136
## Integration with @swc/core
137
138
This package integrates seamlessly with `@swc/core` through automatic platform detection:
139
140
```typescript
141
// @swc/core automatically loads the appropriate binary
142
import { transform } from '@swc/core';
143
144
// The native binary from this package is used transparently
145
const result = await transform(sourceCode, {
146
jsc: {
147
parser: {
148
syntax: 'typescript',
149
tsx: true,
150
},
151
target: 'es2020',
152
},
153
});
154
```
155
156
## Error Handling
157
158
If the native binary cannot be loaded, `@swc/core` will attempt to fall back to the WebAssembly version (`@swc/wasm`) if available.
159
160
## Security and Licensing
161
162
- **License**: Apache-2.0 AND MIT
163
- **Source**: Compiled from the SWC project's Rust codebase
164
- **Verification**: Distributed through official npm registry with package signing
165
166
## Related Packages
167
168
This package is part of the SWC ecosystem's multi-platform binary distribution:
169
170
- `@swc/core`: Main package that uses this binary
171
- `@swc/core-win32-x64-msvc`: Windows 64-bit x64 binary
172
- `@swc/core-linux-x64-gnu`: Linux 64-bit x64 binary
173
- `@swc/core-darwin-x64`: macOS 64-bit x64 binary
174
- And other platform-specific variants
175
176
## Support and Documentation
177
178
For usage instructions and API documentation, refer to the main SWC documentation at https://swc.rs/docs, as this package provides the underlying native implementation without exposing its own API surface.