{"id":13596278,"url":"https://github.com/buxlabs/amd-to-es6","last_synced_at":"2025-10-23T07:54:29.842Z","repository":{"id":11199049,"uuid":"68723668","full_name":"buxlabs/amd-to-es6","owner":"buxlabs","description":"convert amd to es","archived":false,"fork":false,"pushed_at":"2023-10-18T05:53:04.000Z","size":1251,"stargazers_count":36,"open_issues_count":10,"forks_count":17,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-07T19:30:51.122Z","etag":null,"topics":["amd","converter","es6","javascript"],"latest_commit_sha":null,"homepage":"","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/buxlabs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2016-09-20T15:03:16.000Z","updated_at":"2024-06-18T15:32:10.967Z","dependencies_parsed_at":"2022-09-18T08:42:16.075Z","dependency_job_id":"385a19c9-d4e0-4260-9620-08475bde56f3","html_url":"https://github.com/buxlabs/amd-to-es6","commit_stats":{"total_commits":259,"total_committers":11,"mean_commits":"23.545454545454547","dds":0.3938223938223938,"last_synced_commit":"4d27c2f8a3ad6b5bd282ab66d022a8752ad018ef"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buxlabs%2Famd-to-es6","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buxlabs%2Famd-to-es6/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buxlabs%2Famd-to-es6/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buxlabs%2Famd-to-es6/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/buxlabs","download_url":"https://codeload.github.com/buxlabs/amd-to-es6/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230415317,"owners_count":18222158,"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":["amd","converter","es6","javascript"],"created_at":"2024-08-01T16:02:14.531Z","updated_at":"2025-10-23T07:54:29.749Z","avatar_url":"https://github.com/buxlabs.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# AMD to ES converter\n\n![npm](https://img.shields.io/npm/v/@buxlabs/amd-to-es6.svg) [![Codeship](https://img.shields.io/codeship/f6299130-6721-0134-f3f9-02d00f1d3243/master.svg)](https://app.codeship.com/projects/176125)\n\n\u003e AMD (Asynchronous Module Definition) to ES (EcmaScript) Module converter\n\n## Table of Contents\n\n- [Background](#background)\n- [Install](#install)\n- [Usage](#usage)\n- [Examples](#examples)\n- [Maintainers](#maintainers)\n- [Contributing](#contributing)\n- [Credits](#credits)\n- [License](#license)\n\n## Background\n\nAMD was very popular and used in many big applications worldwide. ES Module standard was created much later and with the rise of various bundlers and transpilers it became possible to write modern code with more concise syntax. This tool was created to fill the migration gap, as other tools were not handling some of the edge cases. It should handle most of existing code out of the box.\n\nThis tool exposes both a cli and a programmatic interface.\n\n## Install\n\n`npm install -g @buxlabs/amd-to-es6`\n\n## Usage\n\n### cli\n\nConvert a single file with:\n\n`amdtoes6 app.js \u003e app-es6.js`\n\nConvert multiple files in given dir with:\n\n`amdtoes6 --src=src --dest=build`\n\nConvert multiple files in given dir recursively with:\n\n`amdtoes6 --src=src --dest=build --glob=**/*.js`\n\nConvert multiple files and replace them with:\n\n`amdtoes6 --src=src --replace`\n\n### Options\n```sh\n\n  Usage: amdtoes6 [options]\n\n  Options:\n\n    -s, --src \u003cdirname\u003e     Directory of the source files\n    -d, --dest \u003cdirname\u003e    Directory of the destination files\n    -g, --glob [glob]       Glob pattern for the src to match for input files\n    -r, --recursive         Set glob pattern to **/*.js with no hassle\n    -b, --beautify          Beautify the output\n    --replace           Replace the input files with results\n    --suffix \u003cstring\u003e   Replace suffix of the files\n    --quotes            Single, double or auto quotes in the output\n\n```\n\n### node\n\nConvert a single file with:\n\n```javascript\nconst amdtoes6 = require('@buxlabs/amd-to-es6');\nconst source = 'define({ hello: 'world' });';\nconst result = amdtoes6(source); // export default { hello: 'world' };\n```\n\n## Examples\n\n**AMD**\n\n```javascript\ndefine([\n    'core/view',\n    'subapp/hello/template/layout'\n], function (View, template) {\n    'use strict';\n\n    return View.extend({\n        template: template\n    });\n\n});\n```\n\n**ES**\n\n```javascript\nimport View from 'core/view';\nimport template from 'subapp/hello/template/layout';\n\nexport default View.extend({\n    template: template\n});\n```\n\n**AMD**\n\n```javascript\ndefine(function (require) {\n    'use strict';\n\n    var Marionette = require('marionette');\n\n    return Marionette.Object.extend({\n        initialize: function () {\n            console.log('hello world');\n        }\n    });\n});\n```\n\n**ES**\n\n```javascript\nimport Marionette from 'marionette';\n\nexport default Marionette.Object.extend({\n    initialize: function () {\n        console.log('hello world');\n    }\n});\n```\n\nThere are more examples in the test/fixture directory\n\n## Maintainers\n\n[@emilos](https://github.com/emilos).\n\n## Contributing\n\nAll contributions are highly appreciated! Open an issue or a submit PR.\n\nThe lib follows the tdd approach and is expected to have a high code coverage.\n\n## Credits\n\nhttps://github.com/jonbretman/amd-to-as6\n\n## License\n\nMIT © buxlabs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuxlabs%2Famd-to-es6","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbuxlabs%2Famd-to-es6","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuxlabs%2Famd-to-es6/lists"}