{"id":30066289,"url":"https://github.com/nlibjs/tsm","last_synced_at":"2026-01-20T17:55:05.559Z","repository":{"id":191847953,"uuid":"685786413","full_name":"nlibjs/tsm","owner":"nlibjs","description":"node --import=@nlib/tsm your-script.ts","archived":false,"fork":false,"pushed_at":"2025-08-01T19:40:46.000Z","size":571,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-01T21:43:58.302Z","etag":null,"topics":["esmodules","nodejs","testing","typescript"],"latest_commit_sha":null,"homepage":"","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/nlibjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"gjbkz","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2023-09-01T02:20:27.000Z","updated_at":"2025-08-01T19:40:15.000Z","dependencies_parsed_at":"2023-09-02T02:16:33.948Z","dependency_job_id":"25ad754e-05d2-472f-b9fc-2930ea2edcd1","html_url":"https://github.com/nlibjs/tsm","commit_stats":{"total_commits":92,"total_committers":2,"mean_commits":46.0,"dds":"0.30434782608695654","last_synced_commit":"84a99037205f8062aabc2d28286f015d312cf061"},"previous_names":["nlibjs/mts","nlibjs/tsm"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/nlibjs/tsm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nlibjs%2Ftsm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nlibjs%2Ftsm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nlibjs%2Ftsm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nlibjs%2Ftsm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nlibjs","download_url":"https://codeload.github.com/nlibjs/tsm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nlibjs%2Ftsm/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269383144,"owners_count":24408147,"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","status":"online","status_checked_at":"2025-08-08T02:00:09.200Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["esmodules","nodejs","testing","typescript"],"created_at":"2025-08-08T07:28:29.407Z","updated_at":"2026-01-20T17:55:05.532Z","avatar_url":"https://github.com/nlibjs.png","language":"JavaScript","funding_links":["https://github.com/sponsors/gjbkz"],"categories":[],"sub_categories":[],"readme":"# @nlib/tsm\n\nThin .mts loader and test runner\n\n[![.github/workflows/test.yml](https://github.com/nlibjs/tsm/actions/workflows/test.yml/badge.svg)](https://github.com/nlibjs/tsm/actions/workflows/test.yml)\n[![codecov](https://codecov.io/gh/nlibjs/tsm/graph/badge.svg?token=5fr51K5wli)](https://codecov.io/gh/nlibjs/tsm)\n\n## Install\n\n```\nnpm install @nlib/tsm\n```\n\n## Usage: Run \\*.ts/\\*.mts file\n\n```\nnode --import=@nlib/tsm path/to/your/script.mts\n```\n\n`@nlib/tsm` exports `register.mjs` which [registers](https://nodejs.org/api/module.html#moduleregisterspecifier-parenturl-options) `loader.mjs`. `loader.mjs` is a [loader](https://nodejs.org/api/esm.html#loaders) to customize the default module resolution. It exports the [`load`](https://nodejs.org/api/esm.html#loadurl-context-nextload) function that loads modules with [esbuild](https://esbuild.github.io/).\n\n## Usage: Run test files\n\nNode.js added the stable [`node:test`](https://nodejs.org/api/test.html) in v20. We can run tests with `node --test`. It searches for test files when a directory is specified as arguments. But it doesn't search for `*.mts` (even with the `--experimental-loader` option). So, you must pass the files one by one to run it.\n\nThe `tsm-test` will search for the test files for you and pass them to `node --test`.\n\n```sh\nnpx tsm-test src\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnlibjs%2Ftsm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnlibjs%2Ftsm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnlibjs%2Ftsm/lists"}