{"id":15395104,"url":"https://github.com/goto-bus-stop/dynamic-import-support","last_synced_at":"2025-06-25T22:35:57.368Z","repository":{"id":57217660,"uuid":"105895466","full_name":"goto-bus-stop/dynamic-import-support","owner":"goto-bus-stop","description":"transform dynamic imports for node.js","archived":false,"fork":false,"pushed_at":"2017-10-05T13:55:10.000Z","size":8,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-17T20:06:40.711Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/goto-bus-stop.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-05T13:48:21.000Z","updated_at":"2019-05-31T01:46:54.000Z","dependencies_parsed_at":"2022-08-28T21:41:25.603Z","dependency_job_id":null,"html_url":"https://github.com/goto-bus-stop/dynamic-import-support","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/goto-bus-stop/dynamic-import-support","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goto-bus-stop%2Fdynamic-import-support","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goto-bus-stop%2Fdynamic-import-support/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goto-bus-stop%2Fdynamic-import-support/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goto-bus-stop%2Fdynamic-import-support/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/goto-bus-stop","download_url":"https://codeload.github.com/goto-bus-stop/dynamic-import-support/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goto-bus-stop%2Fdynamic-import-support/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261964750,"owners_count":23237479,"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-10-01T15:25:44.613Z","updated_at":"2025-06-25T22:35:57.344Z","avatar_url":"https://github.com/goto-bus-stop.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dynamic-import-support\n\nenable dynamic imports in node.js\n\n```js\nimport('./whatever').then(function (exports) {\n  console.log(exports)\n})\n```\n\n[![npm][npm-image]][npm-url]\n[![travis][travis-image]][travis-url]\n[![standard][standard-image]][standard-url]\n\n[npm-image]: https://img.shields.io/npm/v/dynamic-import-support.svg?style=flat-square\n[npm-url]: https://www.npmjs.com/package/dynamic-import-support\n[travis-image]: https://img.shields.io/travis/goto-bus-stop/dynamic-import-support.svg?style=flat-square\n[travis-url]: https://travis-ci.org/goto-bus-stop/dynamic-import-support\n[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square\n[standard-url]: http://npm.im/standard\n\n## Install\n\n```\nnpm install dynamic-import-support\n```\n\n## Usage\n\nUse `dynamic-import-support/register` to enable `import()` in all modules loaded after the current one:\n\n```js\nrequire('dynamic-import-support/register')\n```\n\nUse `dynamic-import-support` to transform some source code containing `import()` calls:\n\n```js\nvar dynamicImport = require('dynamic-import-support')\n\ndynamicImport(`\n  import('./whatever').then(function (exports) {\n    console.log(exports)\n  })\n`) === `\nfunction _import(p){return Promise.resolve().then(function(){return require(p)})}\n\n  _import('./whatever').then(function (exports) {\n    console.log(exports)\n  })\n`\n```\n\nIt uses [js-tokens](https://github.com/lydell/js-tokens) instead of a full parser, so it's very quick.\nSome patterns aren't supported though.\nFor example, `import()` inside a template string won't be transformed.\nIf this is a problem, please open an issue and we'll figure out how to make it work :)\n\n## License\n\n[MIT](LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoto-bus-stop%2Fdynamic-import-support","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoto-bus-stop%2Fdynamic-import-support","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoto-bus-stop%2Fdynamic-import-support/lists"}