{"id":13448535,"url":"https://github.com/decaffeinate/decaffeinate","last_synced_at":"2025-05-14T02:04:58.261Z","repository":{"id":25933717,"uuid":"29375063","full_name":"decaffeinate/decaffeinate","owner":"decaffeinate","description":"Goodbye CoffeeScript, hello JavaScript!","archived":false,"fork":false,"pushed_at":"2024-06-21T04:38:32.000Z","size":10196,"stargazers_count":2707,"open_issues_count":40,"forks_count":120,"subscribers_count":22,"default_branch":"main","last_synced_at":"2025-05-03T02:07:37.092Z","etag":null,"topics":["coffeescript","conversion","decaffeinate"],"latest_commit_sha":null,"homepage":"https://decaffeinate-project.org/","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/decaffeinate.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","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":"2015-01-17T01:00:52.000Z","updated_at":"2025-04-11T18:56:10.000Z","dependencies_parsed_at":"2024-11-19T06:05:49.046Z","dependency_job_id":null,"html_url":"https://github.com/decaffeinate/decaffeinate","commit_stats":{"total_commits":2326,"total_committers":44,"mean_commits":52.86363636363637,"dds":0.7037833190025795,"last_synced_commit":"4f42f6bc92e7c7ed09af8cdb0b5e475b8aa3c22c"},"previous_names":[],"tags_count":572,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decaffeinate%2Fdecaffeinate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decaffeinate%2Fdecaffeinate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decaffeinate%2Fdecaffeinate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decaffeinate%2Fdecaffeinate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/decaffeinate","download_url":"https://codeload.github.com/decaffeinate/decaffeinate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252522132,"owners_count":21761684,"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":["coffeescript","conversion","decaffeinate"],"created_at":"2024-07-31T05:01:48.288Z","updated_at":"2025-05-14T02:04:58.233Z","avatar_url":"https://github.com/decaffeinate.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# decaffeinate [![npm](https://img.shields.io/npm/v/decaffeinate.svg)](https://www.npmjs.com/package/decaffeinate) [![Join the chat at https://gitter.im/decaffeinate](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/decaffeinate/Lobby)\n\nGoodbye CoffeeScript, hello JavaScript!\n\nJavaScript is the future, in part thanks to CoffeeScript. Now that it has served\nits purpose, it's time to move on. Convert your CoffeeScript source to modern\nJavaScript with decaffeinate.\n\n## Installation and usage\n\n```sh\n# via yarn\n$ yarn global add decaffeinate\n# via npm\n$ npm install -g decaffeinate\n\n$ decaffeinate input.coffee\ninput.coffee → input.js\n\n# convert all files in directory and subdirectories\n$ decaffeinate .\ninput.coffee → input.js\nsubfolder/input.coffee → subfolder/input.js\n```\n\nAlternatively, paste code into the online [repl] to immediately see the output.\n\nFor real-world use cases, you'll likely want to spend some time understanding\nthe different options and nuances of the decaffeinate tool. You'll also likely\nwant to run decaffeinate using the [bulk-decaffeinate] wrapper tool, or write\nyour own wrapper script. See the [Conversion Guide][conversion-guide] for more\ninformation and advice on running decaffeinate on real-world code, and see\n[Cleanup suggestions after running decaffeinate][suggestions] for advice on\ncleaning up the converted JavaScript code and other things to keep in mind.\n\n## Questions and support\n\nFeel free to join the [gitter chat room](https://gitter.im/decaffeinate/Lobby)\nto ask questions, or you can file an issue on the [issues] page:\n\n- [report a crash][crash-issue]\n- [report incorrect output][wrong-issue]\n- [request a feature][feature-issue]\n\n## Status\n\n**Complete.** The project is stable enough for production use, and has been used\nto convert hundreds of thousands (probably millions) of lines of production\ncode. The conversion process has been extensively tested and there are few or no\nknown correctness bugs, although no guarantees are made.\n\nHere are some popular open source CoffeeScript projects and their current status\nwhen run through decaffeinate. Each project has a decaffeinate-specific fork\nthat is re-created from the original repo once per day.\n\n| Project                                                   | Lines of CoffeeScript |         Conversion status          |         Test status          |\n| --------------------------------------------------------- | :-------------------: | :--------------------------------: | :--------------------------: |\n| [chroma.js]                                               |         3.3K          |   ![chromajs-conversion-status]    |   ![chromajs-test-status]    |\n| [hubot][hubot] [\\[1\\]](#converted-note)                   |         3.7K          |     ![hubot-conversion-status]     |     ![hubot-test-status]     |\n| [autoprefixer][autoprefixer] [\\[1\\]](#converted-note)     |         4.8K          | ![autoprefixer-conversion-status]  | ![autoprefixer-test-status]  |\n| [coffeelint]                                              |         8.8K          |  ![coffeelint-conversion-status]   |  ![coffeelint-test-status]   |\n| [vimium][vimium] [\\[2\\]](#correctness-note)               |          11K          |    ![vimium-conversion-status]     |    ![vimium-test-status]     |\n| [coffeescript][coffeescript] [\\[2\\]](#correctness-note)   |          17K          | ![coffeescript-conversion-status]  | ![coffeescript-test-status]  |\n| [coffeescript2][coffeescript2] [\\[2\\]](#correctness-note) |          17K          | ![coffeescript2-conversion-status] | ![coffeescript2-test-status] |\n| [atom][atom] [\\[1\\]](#converted-note)                     |          51K          |     ![atom-conversion-status]      |     ![atom-test-status]      |\n| [atom-org]                                                |         170K          |   ![atom-org-conversion-status]    |   ![atom-org-test-status]    |\n| [codecombat]                                              |         230K          |  ![codecombat-conversion-status]   |  ![codecombat-test-status]   |\n\n**Project builder status:** [![Build Status](https://travis-ci.org/decaffeinate/decaffeinate-example-builder.svg?branch=master)](https://travis-ci.org/decaffeinate/decaffeinate-example-builder)\n\n**Notes:**\n\n1. \u003ca id='converted-note'\u003e\u003c/a\u003eHubot and Autoprefixer have fully moved to\n   JavaScript using decaffeinate. This build runs on the last commit before the\n   switch to JS. Atom has mostly moved to JavaScript using decaffeinate, so this\n   build runs on an earlier revision that was primarily CoffeeScript.\n2. \u003ca id='correctness-note'\u003e\u003c/a\u003eSome CoffeeScript tests are disabled because\n   they are difficult to fix and test situations that do not seem to come up in\n   real-world code. The Vimium test suite has also been modified slightly to\n   work around a correctness issue. See\n   [How decaffeinate approaches correctness][correctness-issues] for full details.\n\nTo contribute to this list, send a pull request to the [decaffeinate-examples]\nproject.\n\nIn addition, decaffeinate has been used on private codebases within various\ncompanies, such as Square, Benchling, Bugsnag, and DataFox.\n\nSome blog posts on using decaffeinate:\n\n- [From 200K lines of CoffeeScript to zero: making decaffeinate super-stable][benchling-blog-post]\n- [Converting a large React Codebase from Coffeescript to ES6][bugsnag-blog-post]\n- [Decaffeinating a Large CoffeeScript Codebase Without Losing Sleep][datafox-blog-post]\n- [The Great CoffeeScript to Typescript Migration of 2017][dropbox-blog-post]\n\nIf you run into crashes or correctness issues, or you have suggestions on how\ndecaffeinate could be improved, feel free to file an issue on the [issues] page.\n\n[chroma.js]: https://github.com/decaffeinate-examples/chroma.js\n[hubot]: https://github.com/decaffeinate-examples/hubot\n[autoprefixer]: https://github.com/decaffeinate-examples/autoprefixer\n[coffeelint]: https://github.com/decaffeinate-examples/coffeelint\n[vimium]: https://github.com/decaffeinate-examples/vimium\n[coffeescript]: https://github.com/decaffeinate-examples/coffeescript\n[coffeescript2]: https://github.com/decaffeinate-examples/coffeescript2\n[atom]: https://github.com/decaffeinate-examples/atom\n[atom-org]: https://github.com/decaffeinate-examples/atom-org\n[codecombat]: https://github.com/decaffeinate-examples/codecombat\n[decaffeinate-examples]: https://github.com/decaffeinate/decaffeinate-examples\n[chromajs-conversion-status]: https://decaffeinate-examples.github.io/chroma.js/conversion-status.svg\n[chromajs-test-status]: https://decaffeinate-examples.github.io/chroma.js/test-status.svg\n[hubot-conversion-status]: https://decaffeinate-examples.github.io/hubot/conversion-status.svg\n[hubot-test-status]: https://decaffeinate-examples.github.io/hubot/test-status.svg\n[autoprefixer-conversion-status]: https://decaffeinate-examples.github.io/autoprefixer/conversion-status.svg\n[autoprefixer-test-status]: https://decaffeinate-examples.github.io/autoprefixer/test-status.svg\n[coffeelint-conversion-status]: https://decaffeinate-examples.github.io/coffeelint/conversion-status.svg\n[coffeelint-test-status]: https://decaffeinate-examples.github.io/coffeelint/test-status.svg\n[vimium-conversion-status]: https://decaffeinate-examples.github.io/vimium/conversion-status.svg\n[vimium-test-status]: https://decaffeinate-examples.github.io/vimium/test-status.svg\n[coffeescript-conversion-status]: https://decaffeinate-examples.github.io/coffeescript/conversion-status.svg\n[coffeescript-test-status]: https://decaffeinate-examples.github.io/coffeescript/test-status.svg\n[coffeescript2-conversion-status]: https://decaffeinate-examples.github.io/coffeescript2/conversion-status.svg\n[coffeescript2-test-status]: https://decaffeinate-examples.github.io/coffeescript2/test-status.svg\n[atom-conversion-status]: https://decaffeinate-examples.github.io/atom/conversion-status.svg\n[atom-test-status]: https://decaffeinate-examples.github.io/atom/test-status.svg\n[atom-org-conversion-status]: https://decaffeinate-examples.github.io/atom-org/conversion-status.svg\n[atom-org-test-status]: https://decaffeinate-examples.github.io/atom-org/test-status.svg\n[codecombat-conversion-status]: https://decaffeinate-examples.github.io/codecombat/conversion-status.svg\n[codecombat-test-status]: https://decaffeinate-examples.github.io/codecombat/test-status.svg\n[benchling-blog-post]: https://benchling.engineering/from-200k-lines-of-coffeescript-to-zero-making-decaffeinate-super-stable-4de0ca68d9bc\n[bugsnag-blog-post]: https://blog.bugsnag.com/converting-a-large-react-codebase-from-coffeescript-to-es6/\n[datafox-blog-post]: https://eng.datafox.com/javascript/2017/07/18/decaffeinating-large-coffeescript-codebase/\n[dropbox-blog-post]: https://dropbox.tech/frontend/the-great-coffeescript-to-typescript-migration-of-2017\n\n## Goals\n\n- Fully automated conversion of the CoffeeScript language to modern JavaScript.\n- Preserve whitespace, formatting, and comments as much as possible to allow\n  a full one-time conversion of your CoffeeScript source code.\n- Focus on correctness as the first priority, with some options to generate\n  nicer code at the expense of 100% correctness.\n- Provide helpful error messages when it encounters an unsupported language\n  construct.\n\n## Common options\n\n- `--use-cs2`: Treat the input as CoffeeScript 2 code. CoffeeScript 2 has some\n  small breaking changes and differences in behavior compared with CS1, so\n  decaffeinate assumes CS1 by default and allows CS2 via this flag.\n- `--use-js-modules`: Convert `require` and `module.exports` to `import` and\n  `export`. Note that this may result in incorrect import statements because\n  decaffeinate does not know the export style used by the other file. To\n  generate correct imports, use [bulk-decaffeinate][bulk-decaffeinate] and\n  enable the `useJSModules` option.\n\n## Other options\n\n- `--modernize-js`: Treat the input as JavaScript and only run the\n  JavaScript-to-JavaScript transforms, modifying the file(s) in-place.\n- `--literate`: Treat the input file as Literate CoffeeScript.\n- `--disable-suggestion-comment`: Do not include a comment with followup\n  suggestions at the top of the output file.\n- `--no-array-includes`: Do not use `Array.prototype.includes` in generated\n  code.\n- `--safe-import-function-identifiers`: Comma-separated list of function names\n  that may safely be in the `import`/`require` section of the file. All other\n  function calls will disqualify later `require`s from being converted to\n  `import`s.\n- `--prefer-let`: Use `let` instead of `const` for most variables in output\n  code.\n- `--loose`: Enable all `--loose...` options.\n- `--loose-default-params`: Convert CS default params to JS default params.\n- `--loose-for-expressions`: Do not wrap expression loop targets in `Array.from`.\n- `--loose-for-of`: Do not wrap JS `for...of` loop targets in `Array.from`.\n- `--loose-includes`: Do not wrap in `Array.from` when converting `in` to `includes`.\n- `--loose-comparison-negation`: Allow unsafe simplifications like `!(a \u003e b)` to `a \u003c= b`.\n- `--loose-js-modules`: Allow named exports when converting to JS modules.\n- `--disallow-invalid-constructors`: Give an error when constructors use `this`\n  before `super` or omit the `super` call in a subclass.\n- `--optional-chaining`: Target JavaScript optional chaining. Note the semantics may not match exactly.\n- `--nullish-coalescing`: Target JavaScript [nullish coalescing](https://github.com/tc39/proposal-nullish-coalescing). Note the semantics may not match exactly.\n- `--logical-assignment`: Use the ES2021 [logical\n  assignment](https://github.com/tc39/proposal-logical-assignment) operators\n  `\u0026\u0026=`, `||=`, and `??=`.\n\nFor more usage details, see the output of `decaffeinate --help`.\n\n[repl]: http://decaffeinate-project.org/repl/\n[bulk-decaffeinate]: https://github.com/decaffeinate/bulk-decaffeinate\n[issues]: https://github.com/decaffeinate/decaffeinate/issues\n[crash-issue]: https://github.com/decaffeinate/decaffeinate/issues/new?template=crash.md\n[wrong-issue]: https://github.com/decaffeinate/decaffeinate/issues/new?template=wrong.md\n[feature-issue]: https://github.com/decaffeinate/decaffeinate/issues/new?template=feature.md\n[conversion-guide]: https://github.com/decaffeinate/decaffeinate/blob/main/docs/conversion-guide.md\n[suggestions]: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\n[correctness-issues]: https://github.com/decaffeinate/decaffeinate/blob/main/docs/correctness-issues.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecaffeinate%2Fdecaffeinate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdecaffeinate%2Fdecaffeinate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecaffeinate%2Fdecaffeinate/lists"}