Socket
Socket
Sign inDemoInstall

coffeescript

Package Overview
Dependencies
0
Maintainers
3
Versions
73
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

coffeescript

Unfancy JavaScript


Version published
Maintainers
3
Weekly downloads
1,321,520
decreased by-8.66%

Weekly downloads

Package description

What is coffeescript?

CoffeeScript is a programming language that transcompiles to JavaScript. It provides a more concise syntax, additional features not present in JavaScript, and aims to enhance readability and brevity of code. It can be used for server-side scripting with Node.js or client-side scripting in web browsers.

What are coffeescript's main functionalities?

Simplified Syntax

CoffeeScript offers a more readable and expressive syntax compared to JavaScript. This code sample defines a function to square a number using an arrow function and without the need for curly braces or the 'function' keyword.

square = (x) -> x * x

Classes and Inheritance

CoffeeScript supports classes and inheritance, allowing for more structured and object-oriented code. This code sample defines an Animal class and a Dog class that inherits from it, with a constructor and a method.

class Animal
  constructor: (@name) ->
class Dog extends Animal
  bark: -> 'Woof! I am ' + @name

List Comprehensions

CoffeeScript provides list comprehensions, which are a concise way to apply operations to the elements of a collection. This code sample demonstrates creating a new array of cubes from an existing array of numbers.

cubes = (math.cube num for num in list)

Destructuring Assignment

Destructuring assignment syntax in CoffeeScript allows for unpacking values from arrays or properties from objects into distinct variables. This code sample shows how to extract the 'name' and 'value' properties from an object.

{name, value} = object

Other packages similar to coffeescript

Readme

Source
      @@@@@@@                @@@@  @@@@@
     @@@@@@@@@@              @@@   @@@                                           {
    @@@@     @@              @@@   @@@                                        }   }   {
   @@@@          @@@@@@@    @@@   @@@     @@@@@@    @@@@@@                   {   {  }  }
  @@@@          @@@   @@  @@@@@  @@@@@@  @@@   @@  @@@@  @@                   }   }{  {
  @@@@         @@@@   @@   @@@    @@@   @@@   @@@ @@@   @@@                  {  }{  }  }
  @@@@        @@@@    @@   @@@    @@@   @@@@@@@@  @@@@@@@@                  { }{ }{  { }
  @@@@@       @@@@   @@    @@@    @@@   @@@       @@@                     {  { } { } { }  }
   @@@@@@@@@@ @@@@@@@@    @@@    @@@    @@@@@@@@  @@@@@@@@                 { }   { }   { }
      @@@@@               @@@    @@@      @@@@@     @@@@@           @@@@@@   { }   { }    @@@@@@@
                         @@@    @@@                                 @@@@@@@@@@@@@@@@@@@@@@@@@@@@
      @@@@@@            @@@    @@@                                @@ @@@@@@@@@@@@@@@@@@@@@@@@@@
   @@@@    @@          @@@   @@@@                                @@   @@@@@@@@@@@@@@@@@@@@@@@@
   @@@@   @@@                       @@                  @@@@     @@@   @@@@@@@@@@@@@@@@@@@@@
   @@@@@          @@@@@   @@  @@   @@@     @@@@@@@     @@@@@      @@@    @@@@@@@@@@@@@@@@@@
     @@@@@      @@@  @@@ @@@@@@@@         @@@@  @@@@  @@@@@@@       @@@   @@@@@@@@@@@@@@@@
       @@@@@   @@@       @@@@     @@@@    @@@    @@@   @@@                 @@@@@@@@@@@@@@
 @@@@@  @@@@  @@@@      @@@@      @@@@   @@@@   @@@@  @@@@
@@@     @@@@  @@@       @@@@     @@@@    @@@    @@@@  @@@@
@@@     @@@@  @@@@     @@@@      @@@@   @@@@   @@@@  @@@@
 @@@@@@@@@     @@@@@@  @@@@       @@@@  @@@@@@@@@    @@@@
                                       @@@          @@@@
                                      @@@
                                      @@@

CoffeeScript is a little language that compiles into JavaScript.

Installation

Once you have Node.js installed:

# Install locally for a project:
npm install --save-dev coffeescript

# Install globally to execute .coffee files anywhere:
npm install --global coffeescript

Getting Started

Execute a script:

coffee /path/to/script.coffee

Compile a script:

coffee -c /path/to/script.coffee

For documentation, usage, and examples, see: https://coffeescript.org/

To suggest a feature or report a bug: https://github.com/jashkenas/coffeescript/issues

If you’d like to chat, drop by #coffeescript on Freenode IRC.

The source repository: https://github.com/jashkenas/coffeescript.git

Changelog: https://coffeescript.org/#changelog

Our lovely and talented contributors are listed here: https://github.com/jashkenas/coffeescript/contributors

Keywords

FAQs

Last updated on 24 Apr 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc