Socket
Socket
Sign inDemoInstall

coffee-script

Package Overview
Dependencies
Maintainers
4
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coffee-script

Unfancy JavaScript


Version published
Weekly downloads
660K
decreased by-4.57%
Maintainers
4
Weekly downloads
 
Created

Package description

What is coffee-script?

The coffee-script npm package is a language that compiles into JavaScript. It provides a more readable and concise syntax compared to JavaScript, making it easier to write and maintain code. CoffeeScript adds syntactic sugar inspired by Ruby, Python, and Haskell to JavaScript, and it compiles one-to-one into the equivalent JavaScript.

What are coffee-script's main functionalities?

Class Definitions

CoffeeScript provides a simple syntax for defining classes and constructors. The '@' symbol is a shorthand for 'this.' in JavaScript.

class Animal
  constructor: (@name) ->
  speak: -> console.log "#{@name} makes a noise."

Function Definitions

Functions in CoffeeScript are defined using the '->' syntax, which is more concise than JavaScript's 'function' keyword.

square = (x) -> x * x

Array Comprehensions

CoffeeScript supports array comprehensions, allowing for more readable and concise array manipulations.

cubes = (x * x * x for x in [1..10])

String Interpolation

String interpolation in CoffeeScript uses the '#{}' syntax, making it easier to embed expressions within strings.

name = 'world'
greeting = "Hello, #{name}!"

Other packages similar to coffee-script

Readme

Source
        {
     }   }   {
    {   {  }  }
     }   }{  {
    {  }{  }  }                    _____       __  __
   { }{ }{  { }                   / ____|     / _|/ _|
 .- { { }  { }} -.               | |     ___ | |_| |_ ___  ___
(  { } { } { } }  )              | |    / _ \|  _|  _/ _ \/ _ \
|`-..________ ..-'|              | |___| (_) | | | ||  __/  __/
|                 |               \_____\___/|_| |_| \___|\___|
|                 ;--.
|                (__  \            _____           _       _
|                 | )  )          / ____|         (_)     | |
|                 |/  /          | (___   ___ _ __ _ _ __ | |_
|                 (  /            \___ \ / __| '__| | '_ \| __|
|                 |/              ____) | (__| |  | | |_) | |_
|                 |              |_____/ \___|_|  |_| .__/ \__|
 `-.._________..-'                                  | |
                                                    |_|

CoffeeScript is a little language that compiles into JavaScript.

Installation

Once you have Node.js installed:

npm install --global coffeescript

Leave off the --global if you don’t wish to install globally.

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: http://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: http://coffeescript.org/#changelog

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

Keywords

FAQs

Package last updated on 17 Jul 2017

Did you know?

Socket

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
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc