{"id":13474807,"url":"https://github.com/swc-project/swc-node","last_synced_at":"2025-05-11T03:47:07.353Z","repository":{"id":37868322,"uuid":"280068470","full_name":"swc-project/swc-node","owner":"swc-project","description":"Faster ts-node without typecheck","archived":false,"fork":false,"pushed_at":"2025-05-02T13:39:25.000Z","size":5627,"stargazers_count":1894,"open_issues_count":60,"forks_count":81,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-05-08T01:03:18.792Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/swc-project.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["Brooooooklyn"]}},"created_at":"2020-07-16T06:04:37.000Z","updated_at":"2025-05-07T06:51:27.000Z","dependencies_parsed_at":"2023-10-25T03:41:29.157Z","dependency_job_id":"d8d1fef6-4a0f-4df6-a0ac-82b692a29096","html_url":"https://github.com/swc-project/swc-node","commit_stats":{"total_commits":881,"total_committers":51,"mean_commits":"17.274509803921568","dds":0.4290578887627696,"last_synced_commit":"6f162b495fb1414c16d3d30b61dcfcce6afbb260"},"previous_names":["brooooooklyn/swc-node"],"tags_count":321,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swc-project%2Fswc-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swc-project%2Fswc-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swc-project%2Fswc-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swc-project%2Fswc-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/swc-project","download_url":"https://codeload.github.com/swc-project/swc-node/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252978756,"owners_count":21834915,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T16:01:14.946Z","updated_at":"2025-05-08T01:08:31.121Z","avatar_url":"https://github.com/swc-project.png","language":"TypeScript","readme":"# `swc-node`\n\n\u003e 🚀 Help me to become a full-time open-source developer by [sponsoring me on Github](https://github.com/sponsors/Brooooooklyn)\n\n**_Fast `TypeScript/JavaScript` transformer without `node-gyp` and postinstall script_**.\n\n\u003cp\u003e\n  \u003ca href=\"https://github.com/swc-project/swc-node/actions\"\u003e\u003cimg src=\"https://github.com/swc-project/swc-node/workflows/CI/badge.svg\" alt=\"Build Status\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://npmcharts.com/compare/@swc-node/core?minimal=true\"\u003e\u003cimg src=\"https://img.shields.io/npm/dm/@swc-node/core.svg?sanitize=true\" alt=\"Downloads\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/swc-project/swc-node/blob/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/npm/l/@swc-node/core.svg?sanitize=true\" alt=\"License\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Usage\n\nRun TypeScript with node, without compilation or typechecking:\n\n```bash\nnpm i -D @swc-node/register\nnode -r @swc-node/register script.ts\nnode --import @swc-node/register/esm-register script.ts # for esm project with node\u003e=20.6\nnode --loader @swc-node/register/esm script.ts # for esm project with node\u003c=20.5, deprecated\n```\n\nPass `--enable-source-maps` to node for esm projects\n\nSet environment variable SWCRC=true when you would like to load .swcrc file\n\n```bash\nSWCRC=true node -r @swc-node/register script.ts\n```\n\n```typescript\n#!/usr/bin/env -S node --import @swc-node/register/esm-register\n\n// your code\n```\n\nrun 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\n\n## @swc-node/core\n\nFastest `TypeScript` transformer.\n\nDetail: [@swc-node/core](./packages/core)\n\n### Benchmark\n\n\u003e transform RxJS `AjaxObservable.ts` to ES2015 \u0026 CommonJS `JavaScript`. Benchmark code: [bench](./bench/index.ts)\n\n**Hardware info**:\n\n```\nModel Name: MacBook Pro\nModel Identifier: MacBookPro15,1\nProcessor Name: 6-Core Intel Core i7\nProcessor Speed: 2.6 GHz\nNumber of Processors: 1\nTotal Number of Cores: 6\nL2 Cache (per Core): 256 KB\nL3 Cache: 12 MB\nHyper-Threading Technology: Enabled\nMemory: 16 GB\n```\n\n#### `transformSync`\n\n```bash\nesbuild x 510 ops/sec ±1.28% (88 runs sampled)\n@swc-node/core x 438 ops/sec ±1.00% (88 runs sampled)\ntypescript x 28.83 ops/sec ±10.20% (52 runs sampled)\nbabel x 24.21 ops/sec ±10.66% (46 runs sampled)\nTransform rxjs/AjaxObservable.ts benchmark bench suite: Fastest is esbuild\n```\n\n#### `transform` parallel\n\n`UV_THREADPOOL_SIZE=11 yarn bench`\n\n```bash\n@swc-node/core x 1,253 ops/sec ±0.90% (75 runs sampled)\nesbuild x 914 ops/sec ±1.31% (77 runs sampled)\nTransform rxjs/AjaxObservable.ts parallel benchmark bench suite: Fastest is @swc-node/core\n```\n\n`yarn bench`\n\n```bash\n@swc-node/core x 1,123 ops/sec ±0.95% (77 runs sampled)\nesbuild x 847 ops/sec ±3.74% (71 runs sampled)\nTransform rxjs/AjaxObservable.ts parallel benchmark bench suite: Fastest is @swc-node/core\n```\n\n## @swc-node/jest\n\nFastest jest `TypeScript` transformer.\n\nDetail: [@swc-node/jest](./packages/jest)\n\n### Performance glance\n\n\u003e Testing in pure `TypeScript` project, compile target is `ES2018`.\n\u003e Running with `npx jest --no-cache`, `ts-jest` was configured with `isolatedModules: true`\n\n#### ts-jest\n\n```\nTest Suites: 49 passed, 49 total\nTests:       254 passed, 254 total\nSnapshots:   53 passed, 53 total\nTime:        54.631 s\nRan all test suites.\n✨  Done in 62.71s.\n```\n\n#### @swc-node/jest\n\n```\nTest Suites: 49 passed, 49 total\nTests:       254 passed, 254 total\nSnapshots:   53 passed, 53 total\nTime:        10.511 s\nRan all test suites.\n✨  Done in 14.34s.\n```\n\n## @swc-node/register\n\nFaster `ts-node/register/transpile-only` alternative.\n\nDetail: [@swc-node/register](./packages/register)\n\n## Development\n\n### Install dependencies\n\n- `pnpm i`\n\n### Build and Test\n\n- `pnpm build`\n\n- `pnpm test`\n\n## Sponsors\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://sponsors.lyn.one/sponsors.svg\" alt=\"sponsors\" /\u003e\n\u003c/p\u003e\n","funding_links":["https://github.com/sponsors/Brooooooklyn"],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswc-project%2Fswc-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswc-project%2Fswc-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswc-project%2Fswc-node/lists"}