{"id":25167389,"url":"https://github.com/thdk/require-esm-demo","last_synced_at":"2025-04-03T18:19:04.107Z","repository":{"id":276150878,"uuid":"928385875","full_name":"thdk/require-esm-demo","owner":"thdk","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-07T09:26:50.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-05T10:02:23.387Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thdk.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2025-02-06T14:53:28.000Z","updated_at":"2025-02-07T09:26:54.000Z","dependencies_parsed_at":"2025-02-06T15:42:49.319Z","dependency_job_id":"97a32033-6480-4258-b832-9edcccb45c62","html_url":"https://github.com/thdk/require-esm-demo","commit_stats":null,"previous_names":["thdk/require-esm-demo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thdk%2Frequire-esm-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thdk%2Frequire-esm-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thdk%2Frequire-esm-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thdk%2Frequire-esm-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thdk","download_url":"https://codeload.github.com/thdk/require-esm-demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247052617,"owners_count":20875685,"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":"2025-02-09T06:34:24.786Z","updated_at":"2025-04-03T18:19:04.076Z","avatar_url":"https://github.com/thdk.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Demo application using nestjs (commonjs) which imports got (esm module)\n\nThis applicaiton requires node 22.12.0 or higher.\n\n```sh\n# Require force because we are using beta typescript version which doesn't match peerDependency requirements of dependencies.\nnpm install --force\nnpx nx serve\n```\n\n```json\n{\n  \"//\": \"package.json\",\n  \"...\": \"...\",\n  \"type\": \"commonjs\",\n  \"dependencies\": {\n    \"...\": \"...\",\n    \"got\": \"^14.4.5\"\n  },\n  \"devDependencies\": {\n    \"...\": \"...\",\n    \"typescript\": \"5.8.0-beta\"\n  },\n  \"overrides\": {\n    \"typescript\": \"5.8.0-beta\"\n  },\n  \"engines\": {\n    \"node\": \"\u003e=22.12.0\"\n  }\n}\n```\n\n```json\n{\n  \"//\": \"tsconfig.json\",\n  \"compilerOptions\": {\n    \"...\": \"...\",\n    \"moduleResolution\": \"nodenext\",\n    \"module\": \"NodeNext\"\n  },\n  \"...\": \"...\"\n}\n```\n\n```ts\n// app.service.ts\nimport { Injectable } from '@nestjs/common';\n\nimport got from 'got'; // \u003c-- importing esm module\n\n@Injectable()\nexport class AppService {\n  async getData() {\n    return await got.get('https://dummyjson.com/test').json\u003c{\n      status: string;\n      method: string;\n    }\u003e();\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthdk%2Frequire-esm-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthdk%2Frequire-esm-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthdk%2Frequire-esm-demo/lists"}