{"id":21565154,"url":"https://github.com/cfware/execute-esm-export","last_synced_at":"2025-03-18T05:17:31.333Z","repository":{"id":66026894,"uuid":"230313332","full_name":"cfware/execute-esm-export","owner":"cfware","description":"Execute an ESM export","archived":false,"fork":false,"pushed_at":"2020-06-01T01:09:40.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-24T11:44:45.589Z","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/cfware.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2019-12-26T18:55:33.000Z","updated_at":"2020-03-05T20:39:35.000Z","dependencies_parsed_at":"2023-07-21T06:45:32.550Z","dependency_job_id":null,"html_url":"https://github.com/cfware/execute-esm-export","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfware%2Fexecute-esm-export","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfware%2Fexecute-esm-export/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfware%2Fexecute-esm-export/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfware%2Fexecute-esm-export/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cfware","download_url":"https://codeload.github.com/cfware/execute-esm-export/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244160055,"owners_count":20408021,"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-24T10:18:36.390Z","updated_at":"2025-03-18T05:17:31.325Z","avatar_url":"https://github.com/cfware.png","language":"JavaScript","readme":"# execute-esm-export\n\n[![Travis CI][travis-image]][travis-url]\n[![Greenkeeper badge][gk-image]](https://greenkeeper.io/)\n[![NPM Version][npm-image]][npm-url]\n[![NPM Downloads][downloads-image]][downloads-url]\n[![MIT][license-image]](LICENSE)\n\nExecute an ESM export\n\n## Node.js version support\n\nThis module officially requires node.js 13.3.0 or above.  It may be possible to use with\nolder versions of node.js but `--experimental-modules` would need to be set.  Issues will\nonly be fixed if present in versions of node.js where ES modules are unflagged.\n\n## Writing callable exports\n\n```js\n// exports.mjs\nexport function named(...args) {\n  console.log('named function called with args:', args);\n}\n\nexport async function rejection(...args) {\n  console.log('rejection function called with args:', args);\n  throw new Error('This async (Promise) rejection will be caught and reported');\n}\n\nexport default function (...args) {\n  console.log('default function called with args:', args);\n}\n```\n\n## Executing\n\nThe arguments pattern is `execute-esm-export [exportName [...args]]`.  If `[...args]`\nare being provided then the `exportName` must also be provided.\n\n```sh\nnpx execute-esm-export exports.mjs\n# -\u003e default function called with args: []\n\nnpx execute-esm-export exports.mjs default arg1 arg2\n# -\u003e default function called with args: [ 'arg1', 'arg2' ]\n\nnpx execute-esm-export exports.mjs named arg1 arg2\n# -\u003e named function called with args: [ 'arg1', 'arg2' ]\n```\n\n\n[npm-image]: https://img.shields.io/npm/v/execute-esm-export.svg\n[npm-url]: https://npmjs.org/package/execute-esm-export\n[travis-image]: https://travis-ci.org/cfware/execute-esm-export.svg?branch=master\n[travis-url]: https://travis-ci.org/cfware/execute-esm-export\n[gk-image]: https://badges.greenkeeper.io/cfware/execute-esm-export.svg\n[downloads-image]: https://img.shields.io/npm/dm/execute-esm-export.svg\n[downloads-url]: https://npmjs.org/package/execute-esm-export\n[license-image]: https://img.shields.io/npm/l/execute-esm-export.svg\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfware%2Fexecute-esm-export","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcfware%2Fexecute-esm-export","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfware%2Fexecute-esm-export/lists"}