Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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

  • 1.12.7
  • latest
  • stable
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
967K
increased by11.82%
Maintainers
4
Weekly downloads
 
Created

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

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

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc