{"id":15170512,"url":"https://github.com/mborne/ts-examples","last_synced_at":"2026-02-05T13:32:24.350Z","repository":{"id":250014687,"uuid":"734289665","full_name":"mborne/ts-examples","owner":"mborne","description":"[DEV] Some TypeScript examples written to get started with tooling setup (tsx, mocha, chai, nyc, tsup)","archived":false,"fork":false,"pushed_at":"2024-07-24T14:41:10.000Z","size":219,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-18T02:21:32.272Z","etag":null,"topics":["chai","example","mocha","nyc","tsx","typescript"],"latest_commit_sha":null,"homepage":"","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/mborne.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2023-12-21T10:14:47.000Z","updated_at":"2024-07-24T15:16:55.000Z","dependencies_parsed_at":"2024-07-24T18:49:50.556Z","dependency_job_id":"07ff7ef6-8c17-4b85-a335-005f35d87995","html_url":"https://github.com/mborne/ts-examples","commit_stats":null,"previous_names":["mborne/ts-examples"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mborne/ts-examples","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mborne%2Fts-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mborne%2Fts-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mborne%2Fts-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mborne%2Fts-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mborne","download_url":"https://codeload.github.com/mborne/ts-examples/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mborne%2Fts-examples/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29122612,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T10:47:47.471Z","status":"ssl_error","status_checked_at":"2026-02-05T10:45:08.119Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["chai","example","mocha","nyc","tsx","typescript"],"created_at":"2024-09-27T08:03:34.417Z","updated_at":"2026-02-05T13:32:24.334Z","avatar_url":"https://github.com/mborne.png","language":"TypeScript","readme":"# ts-examples\n\nSome TypeScript examples written to get started with tooling setup ([tsx](https://tsx.is/getting-started), mocha, chai, nyc and [tsup](https://tsup.egoist.dev/)).\n\n## Requirements\n\n* [NodeJS \u003e= 20](https://nodejs.org/fr)\n\n## Examples\n\n| Description                                  | Source                               | Test                                             | CLI                                  |\n| -------------------------------------------- | ------------------------------------ | ------------------------------------------------ | ------------------------------------ |\n| `pow(x,n)` as `x^n`                          | [src/pow.ts](src/pow.ts)             | [test/pow.spec.ts](test/pow.spec.ts)             |                                      |\n| Fibonacci **generator**                      | [src/fibonacci.ts](src/fibonacci.ts) | [test/fibonacci.spec.ts](test/fibonacci.spec.ts) | [cli/fibonacci.ts](cli/fibonacci.ts) |\n| Take n elements from a **generic** generator | [src/take.ts](src/take.ts)           | [test/fibonacci.spec.ts](test/take.spec.ts)      | [cli/take.ts](cli/take.ts)           |\n\n## Usage\n\n### Run cli examples\n\n```bash\nnpx tsx cli/fibonacci.ts\n```\n\n### Run tests\n\n\u003e See [.mocharc.json](.mocharc.json) \n\n```bash\n# run all tests\nnpm run test\n# run single test file\nnpm run test test/pow.spec.ts\n```\n\n### Check test coverage\n\n\u003e See [.nycrc](.nycrc) \n\n```bash\n# run all tests\nnpm run coverage\n```\n\n### Bundling\n\nSee [tsup.config.ts](tsup.config.ts), [package.json - main, module, types and exports](package.json) :\n\n```bash\nnpm run build\n```\n\nIt allows :\n\n* Usage in [index.html](index.html)\n* Usage with `import` syntax (ES module) :\n\n```js\nimport {pow} from '@mborne/ts-examples';\n\nconsole.log(pow(10,3));\n```\n\n* Usage with `require` syntax (CommonJS) :\n\n```js\nconst pow = require('@mborne/ts-examples').pow;\n\nconsole.log(pow(10,3));\n```\n\n\n## Credits\n\nBunding method taken from [Turfjs](https://github.com/Turfjs/turf/blob/master/tsup.config.ts)\n\n## License\n\n[MIT](LICENSE)\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmborne%2Fts-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmborne%2Fts-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmborne%2Fts-examples/lists"}