swc-node
π Help me to become a full-time open-source developer by sponsoring me on Github
Fast TypeScript/JavaScript transformer without node-gyp and postinstall script.
Usage
Run TypeScript with node, without compilation or typechecking:
npm i -D @swc-node/register
node -r @swc-node/register script.tsSupport matrix
| node10 | node12 | node14 | node16 | |
|---|---|---|---|---|
| Windows x64 | β | β | β | β |
| Windows x32 | β | β | β | β |
| Windows arm64 | β | β | β | β |
| macOS x64 | β | β | β | β |
| macOS arm64 | β | β | β | β |
| Linux x64 gnu | β | β | β | β |
| Linux x64 musl | β | β | β | β |
| Linux arm gnueabihf | β | β | β | β |
| Linux arm64 gnu | β | β | β | β |
| Linux arm64 musl | β | β | β | β |
| Android arm64 | β | β | β | β |
| FreeBSD x64 | β | β | β | β |
@swc-node/core
Fastest TypeScript transformer.
Detail: @swc-node/core
Benchmark
transform RxJS
AjaxObservable.tsto ES2015 & CommonJSJavaScript. Benchmark code: bench
Hardware info:
Model Name: MacBook Pro
Model Identifier: MacBookPro15,1
Processor Name: 6-Core Intel Core i7
Processor Speed: 2.6 GHz
Number of Processors: 1
Total Number of Cores: 6
L2 Cache (per Core): 256 KB
L3 Cache: 12 MB
Hyper-Threading Technology: Enabled
Memory: 16 GB
transformSync
esbuild x 510 ops/sec Β±1.28% (88 runs sampled)
@swc-node/core x 438 ops/sec Β±1.00% (88 runs sampled)
typescript x 28.83 ops/sec Β±10.20% (52 runs sampled)
babel x 24.21 ops/sec Β±10.66% (46 runs sampled)
Transform rxjs/AjaxObservable.ts benchmark bench suite: Fastest is esbuildtransform parallel
UV_THREADPOOL_SIZE=11 yarn bench
@swc-node/core x 1,253 ops/sec Β±0.90% (75 runs sampled)
esbuild x 914 ops/sec Β±1.31% (77 runs sampled)
Transform rxjs/AjaxObservable.ts parallel benchmark bench suite: Fastest is @swc-node/coreyarn bench
@swc-node/core x 1,123 ops/sec Β±0.95% (77 runs sampled)
esbuild x 847 ops/sec Β±3.74% (71 runs sampled)
Transform rxjs/AjaxObservable.ts parallel benchmark bench suite: Fastest is @swc-node/core@swc-node/jest
Fastest jest TypeScript transformer.
Detail: @swc-node/jest
Performance glance
Testing in pure
TypeScriptproject, compile target isES2018. Running withnpx jest --no-cache,ts-jestwas configured withisolatedModules: true
ts-jest
Test Suites: 49 passed, 49 total
Tests: 254 passed, 254 total
Snapshots: 53 passed, 53 total
Time: 54.631 s
Ran all test suites.
β¨ Done in 62.71s.
@swc-node/jest
Test Suites: 49 passed, 49 total
Tests: 254 passed, 254 total
Snapshots: 53 passed, 53 total
Time: 10.511 s
Ran all test suites.
β¨ Done in 14.34s.
@swc-node/register
Faster ts-node/register/transpile-only alternative.
Detail: @swc-node/register
Development
Install dependencies
pnpmlatest
Build and test
pnpm installpnpm test

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
