{"id":18980639,"url":"https://github.com/sublimetext/coffeescript","last_synced_at":"2026-03-12T20:13:37.869Z","repository":{"id":6065759,"uuid":"7291530","full_name":"SublimeText/CoffeeScript","owner":"SublimeText","description":"Syntax highlighting and checking, commands, shortcuts, snippets, watched compilation and more.","archived":false,"fork":false,"pushed_at":"2026-02-01T13:51:45.000Z","size":936,"stargazers_count":443,"open_issues_count":26,"forks_count":64,"subscribers_count":13,"default_branch":"master","last_synced_at":"2026-02-01T23:25:27.563Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"CoffeeScript","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/SublimeText.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2012-12-22T23:33:44.000Z","updated_at":"2026-02-01T13:51:48.000Z","dependencies_parsed_at":"2025-12-18T16:01:15.020Z","dependency_job_id":null,"html_url":"https://github.com/SublimeText/CoffeeScript","commit_stats":null,"previous_names":["sublimetext/bettercoffeescript","sublimetext/coffeescript","aponxi/sublime-better-coffeescript"],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/SublimeText/CoffeeScript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SublimeText%2FCoffeeScript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SublimeText%2FCoffeeScript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SublimeText%2FCoffeeScript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SublimeText%2FCoffeeScript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SublimeText","download_url":"https://codeload.github.com/SublimeText/CoffeeScript/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SublimeText%2FCoffeeScript/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30441857,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T14:34:45.044Z","status":"ssl_error","status_checked_at":"2026-03-12T14:09:33.793Z","response_time":114,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-08T16:07:24.220Z","updated_at":"2026-03-12T20:13:37.840Z","avatar_url":"https://github.com/SublimeText.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CoffeeScript \u003cimg src=\"logo.svg\" title=\"CoffeeScript\" width=\"32\" height=\"32\"\u003e\n\n[CoffeeScript](https://coffeescript.org/) syntax definitions build system and snippets for [Sublime Text](https://www.sublimetext.com).\n\n![preview](preview.png)\n\n**This package is for Sublime Text 3+**.\nAn old version for Sublime Text 2 is accessible via the [`st2` branch](https://github.com/SublimeText/BetterCoffeeScript/tree/st2).\n\n# Installation\n\n### Package Control\n\nThe easiest way to install is using [Package Control](https://packagecontrol.io). It's listed as `CoffeeScript`.\n\n1. Open `Command Palette` using \u003ckbd\u003ectrl+shift+P\u003c/kbd\u003e or menu item `Tools → Command Palette...`\n2. Choose `Package Control: Install Package`\n3. Find `CoffeeScript` and hit \u003ckbd\u003eEnter\u003c/kbd\u003e\n\n### Manual Install\n\n1. Download appropriate [CoffeeScript.sublime-package](https://github.com/SublimeText/CoffeeScript/releases) for your Sublime Text build.  \n2. Copy it into _Installed Packages_ directory\n\n\u003e [!NOTE]\n\u003e\n\u003e To find _Installed Packages_...\n\u003e\n\u003e 1. call _Menu \u003e Preferences \u003e Browse Packages.._\n\u003e 2. Navigate to parent folder\n\n\u003e [!WARNING]\n\u003e\n\u003e Manually installed packages are not automatically updated by Package Control.\n\n### Source Control\n\n\u003e [!TIP]\n\u003e\n\u003e Only recommended, if contributions to this package are planned.\n\nSublime stores packages in the following locations:\n\n```sh\nNix: ~/.config/sublime-text/packages\nMac: ~/Library/Application\\ Support/Sublime\\ Text/Packages\nWin: %APPDATA%\\Sublime Text\\Packages\n```\n\n#### As a repository within the packages directory\n\nOpen a Terminal/Console and run the following commands, replacing `PACKAGE_PATH` with the path corresponding to your OS above.\n\n```sh\ncd PACKAGE_PATH\ngit clone https://github.com/SublimeText/BetterCoffeeScript.git \"CoffeeScript\"\n```\n\n#### As a repository outside of the packages directory\n\nIf you use Github for Mac/Windows which store repositories in a specific location, or if you just don't want a repository in your packages directory, then instead you can use a link.\n\n1. Clone the repository via GUI program or command line:\n   \n   ```sh\n   cd WHEREVER_YOU_WANT\n   git clone https://github.com/SublimeText/BetterCoffeeScript.git\n   ```\n\n2. Once that is done, create the link:\n\n   **Windows:**\n   \n   ```sh\n   cd PACKAGE_PATH\n   mklink /D \"CoffeeScript\" ABSOLUTE_PATH_TO_REPOSITORY\n   ```\n   \n   **Nix/Mac:**\n   \n   ```sh\n   cd PACKAGE_PATH\n   ln -s ABSOLUTE_PATH_TO_REPOSITORY \"CoffeeScript\"\n   ```\n\n# Commands/Shortcuts\n\nYou can access the commands either using the command palette (`ctrl+shift+P` or `cmd+shift+P`) or via shortcuts.\n\n  alt+shift+t - Run a Cake task\n  alt+shift+r - Run some CoffeeScript (prints output to a panel on the bottom)\n  alt+shift+s - Run a syntax check\n  alt+shift+c - Compile a file\n  alt+shift+d - Display compiled JavaScript\n  alt+shift+l - Display lexer tokens\n  alt+shift+n - Display parser nodes\n  alt+shift+w - Toggle watch mode\n  alt+shift+p - Toggle output panel\n\n\nContext menu has `Compile Output` that compiles the current CoffeeScript and outputs the javascript code that is run, in a panel.\n\n**Note:** Some of the commands use the Status Bar for output, so you'll probably want to enable it (View » Show Status Bar).\n\n# Snippets\n\n- Use `TAB` to run a snippet after typing the trigger.\n- Use `TAB` and `shift+TAB` to cycle forward/backward through fields.\n- Use `ESC` to exit snippet mode.\n\n### Snippet Triggers\n\n**Comprehension**\n\n  Array:  forin\n  Object: forof\n  Range:  fori (inclusive)\n  Range:  forx (exclusive)\n\n**Statements**\n\n  If:        if\n  Else:      el\n  If Else:   ifel\n  Else If:   elif\n  Switch:    swi\n  Ternary:   ter\n  Try Catch: try\n  Unless:    unl\n\n**Classes**\n\n  Class - cla\n  Class extends SuperClass - clx\n\n**Other**\n\n  Function:      -\n  Function:      = (bound)\n  Interpolation: #\n\n# Building\n\n\u003e When using the build system, it is assumed that your `.sublime-project` file lives in your project's base directory (due to limitations with the build system).\n\nHitting `F7` (Tools » Build) will run the Cake task 'sbuild'.\n\nIf you're not quite sure what the point of this is then read on.\n\nLet's say before distributing your project that you would like to combine all of your `.js` files into one and then minify them them using UglifyJS or something.\n\nThat's what this is for! You would create a `Cakefile` and inside it you would write a task:\n\n  task 'sbuild', 'Prepare project for distribution.', -\u003e\n    # ...\n\n# Settings\n\nGo to `Preferences \u003e Package Settings \u003e CoffeeScript \u003e Settings - User` to change settings.\n\n```jsonc\n{\n  /*\n    The directories you would like to include in $PATH environment variable.\n    Use this if your node installation is at a separate location and getting errors such as `cannot find node executable`\n\n    example:\n    \"envPATH\": \"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\n\n  */\n  \"envPATH\": \"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\",\n  /*\n    The directory containing your coffee binary. Usually\n    /usr/local/bin.\n  */\n  \"binDir\": \"/usr/local/bin\",\n\n  /*\n    Compile without the top-level function wrapper (coffee -b).\n  */\n\n  \"noWrapper\": true,\n\n  /*\n    Enable or disable refresh the compiled Output on Save.\n    Only available for watch mode.\n  */\n  \"watchOnSave\": true,\n  /*\n    Enable refreshing compiled JS when CoffeeScript is modified.\n\n    Put false to disable\n    Put a number of seconds to delay the refresh\n  */\n  \"watchOnModified\": 0.5,\n  /*\n    Enable Compiling on save. It will compile into the same folder.\n  */\n  \"compileOnSave\": true,\n  /*\n    ## Enable outputting the results of the compiled coffeescript in a panel\n  */\n  \"showOutputOnSave\": false,\n  /*\n    ## Enable compiling to a specific directory.\n    #### Description\n\n    if it is a string like 'some/directory' then `-o some/directory` will be added to `coffee` compiler.\n    if it is false or not string then it will compile your `script.coffee` to the directory it is in.\n\n    #### Example:\n    Directory is relative to the file you are editing if specified such as\n      compileDir\": \"out\"\n    Directory is absolute if specified such as\n      compileDir\": \"/home/logan/Desktop/out\"\n\n  */\n  \"compileDir\": false,\n  /*\n    ## Enable compiling to a specific relative directories.\n\n    #### Example:\n    Set absolute path for compile dir:\n      \"compileDir\": \"/home/user/projects/js\"\n    And specified folders\n      \"relativeDir\": \"/home/user/projects/coffee\"\n      \"compilePaths\":\n      {\n        \"/home/user/projects/coffee\": \"/home/user/projects/first/js\",\n        \"/home/user/projects/second/coffee\": \"../js\",\n      }\n\n    So\n      \"/home/user/projects/coffee/app.coffee\" will compile to \"/home/user/projects/first/js/app.js\"\n      \"/home/user/projects/coffee/models/prod.coffee\" will compile to \"/home/user/projects/first/js/models/prod.js\"\n      \"/home/user/projects/coffee/second/coffee/app2.coffee\" will compile to \"/home/user/projects/second/js/app2.js\"\n      \"/home/user/projects/main.coffee\" will compile to \"/home/user/projects/js/main.js\"\n\n  */\n  \"compilePaths\": false,\n}\n```\n\n## Project settings\n\nGo to `Project \u003e Edit Project` to change project settings.\n\n```json\n{\n  \"folders\": [\n    \".\"\n  ],\n  \"settings\": {\n    \"CoffeeScript\": {\n      \"noWrapper\": true,\n      \"compileOnSave\": true,\n      \"compileDir\": \"out\"\n    }\n  }\n}\n```\n\n# FAQ\n\nMost of the linux terminal commands written here can be run via [cygwin](http://cygwin.com/install.html) - aka Linux Terminal in Windows.\n\n- Most of the problems are related to configurations. Remember to configure `binDir` after you install!\n\n\n- Do I have coffee-script installed?\n\nTry finding coffee-script in your global npm list with `npm ls -g | grep coffee` which will output something like:\n\n```bash\nnpm ls -g | grep coffee\n\n# will output:\n#├── coffee-script@1.6.3\n#├─┬ coffeelint@0.5.6\n#│ ├── coffee-script@1.6.3\n#├── UNMET DEPENDENCY generator-coffee *\n#│ │ ├── coffee-script@1.3.3\n```\n\n\n- Where can I find out the path to coffee binary?\n\nIn Linux `which` command will tell you where a command originates from. In terminal type:\n\n```bash\nwhich coffee\n# /usr/bin/coffee\n```\n\nThis path will go into the `binDir` setting.\n\n- I'm getting the error message `'coffee' is not recognized as an internal or external command,` when saving.\n\nThe coffee-script binary probably is not installed. Either install coffee-script or set `checkSyntaxOnSave` and `compileOnSave` to `false` in `Preferences \u003e Package Settings \u003e CoffeeScript \u003e Settings - User`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsublimetext%2Fcoffeescript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsublimetext%2Fcoffeescript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsublimetext%2Fcoffeescript/lists"}