{"id":20159559,"url":"https://github.com/transloadit/ts-fly","last_synced_at":"2025-04-09T23:35:24.314Z","repository":{"id":166030133,"uuid":"641461006","full_name":"transloadit/ts-fly","owner":"transloadit","description":"Run TS on-the-fly on Node.js","archived":false,"fork":false,"pushed_at":"2024-03-13T14:09:14.000Z","size":67,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-03-24T01:25:15.198Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/transloadit.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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}},"created_at":"2023-05-16T14:12:34.000Z","updated_at":"2024-05-22T20:18:42.000Z","dependencies_parsed_at":"2024-03-13T14:58:59.761Z","dependency_job_id":"6cfc3a94-fd68-49ea-a288-7667c6ef0203","html_url":"https://github.com/transloadit/ts-fly","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transloadit%2Fts-fly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transloadit%2Fts-fly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transloadit%2Fts-fly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transloadit%2Fts-fly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/transloadit","download_url":"https://codeload.github.com/transloadit/ts-fly/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248130547,"owners_count":21052765,"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-11-14T00:08:58.120Z","updated_at":"2025-04-09T23:35:24.279Z","avatar_url":"https://github.com/transloadit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @transloadit/ts-fly\n\n`ts-fly` is a simple wrapper around Node.js that registers [Sucrase][] hooks,\nmaking it possible to run TypeScript files in addition to JavaScript files\ntransparently. The difference with Sucrase is that it would let you import\nESM-only libraries, as well as `.ts` files.\n\nTypeScript and JavaScript files can also import each other.\n\nDo not use this on production: Sucrase devs already recommend you not to run\ntheir code on production, the code we're adding in this repo is even more unsafe\nand tailored to Transloadit needs. If you do, you are on your own.\n\n## Install\n\n```sh\nyarn add --dev @transloadit/ts-fly\n```\n\n## Usage\n\nUse the `ts-fly` command the same as you would use `node`. Any CLI arguments are\npassed along.\n\n```sh\nyarn ts-fly myFile.ts\n```\n\nYou can use it with `--require` CLI flag:\n\n```sh\nnode -r @transloadit/ts-fly myFile.ts\n```\n\nYou can also `require` it from JS:\n\n```js\n'use strict';\n\nrequire('@transloadit/ts-fly').defaultHooks();\n\nrequire('./myFile.ts'); // works\n```\n\n### Limitations\n\n- You can't import `.ts` files from ESM. If you want to use ESM syntax, you have\n  convert the file to TS and use `.ts` file extension, or use\n  [`createRequire`](https://nodejs.org/api/module.html#modulecreaterequirefilename).\n- By default, we only support `.js` and `.ts` file extensions.\n- Windows would only support the `node -r @transloadit/ts-fly …` form, as the\n  executable is a POSIX shell script.\n- Only literal specifiers which start with `./` and do not contain any `'` or\n  `\"` char are fully supported. Support for dynamic imports with dynamic\n  specifiers is limited.\n\n## Contributing\n\n```sh\ncorepack yarn\ncorepack yarn test\n```\n\n## Based on\n\n- \u003chttps://github.com/alangpierce/sucrase/blob/7284b3733aa114b3f4f5371e36ff5a4704ec860e/bin/sucrase-node\u003e\n- \u003chttps://github.com/alangpierce/sucrase/blob/7284b3733aa114b3f4f5371e36ff5a4704ec860e/src/register.ts\u003e\n\n[Sucrase]: https://github.com/alangpierce/sucrase\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftransloadit%2Fts-fly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftransloadit%2Fts-fly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftransloadit%2Fts-fly/lists"}