GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - DependencyCodeEditorLand/SWCNode: Faster ts-node without typecheck

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

1,015 Commits
1,015 Commits

Folders and files

NameName
Last commit message
Last commit date
.changeset
.changeset
 
 
.husky
.husky
 
 
bench
bench
 
 
packages
packages
 
 
.eslintignore
.eslintignore
 
 
.eslintrc.yml
.eslintrc.yml
 
 
.gitignore
.gitignore
 
 
.npmrc
.npmrc
 
 
.prettierignore
.prettierignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
jest.config.js
jest.config.js
 
 
lerna.json
lerna.json
 
 
package.json
package.json
 
 
pnpm-workspace.yaml
pnpm-workspace.yaml
 
 
renovate.json
renovate.json
 
 
tsconfig.json
tsconfig.json
 
 
tsconfig.lint.json
tsconfig.lint.json
 
 
tsconfig.test.json
tsconfig.test.json
 
 

Repository files navigation

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.

Build Status Downloads License

Usage

Run TypeScript with node, without compilation or typechecking:

npm i -D @swc-node/register
node -r @swc-node/register script.ts
node --import @swc-node/register/esm-register script.ts # for esm project with node>=20.6
node --loader @swc-node/register/esm script.ts # for esm project with node<=20.5, deprecated

Pass --enable-source-maps to node for esm projects

Set environment variable SWCRC=true when you would like to load .swcrc file

SWCRC=true node -r @swc-node/register script.ts
#!/usr/bin/env -S node --import @swc-node/register/esm-register

// your code

run with shebang, add TS_NODE_PROJECT=null(#!/usr/bin/env TS_NODE_PROJECT=null node --import @swc-node/register/esm-register) to use ignore tsconfig.json

@swc-node/core

Fastest TypeScript transformer.

Detail: @swc-node/core

Benchmark

transform RxJS AjaxObservable.ts to ES2015 & CommonJS JavaScript. 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 esbuild

transform 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/core

yarn 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 TypeScript project, compile target is ES2018. Running with npx jest --no-cache, ts-jest was configured with isolatedModules: 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

  • pnpm i

Build and Test

  • pnpm build

  • pnpm test

Sponsors

sponsors

About

Faster ts-node without typecheck

Resources

Readme
MIT license
Activity
Custom properties

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.