Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
coffee-script
Advanced tools
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.
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}!"
TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. It adds optional static types, classes, and interfaces, making it more suitable for large-scale applications. Unlike CoffeeScript, TypeScript focuses on type safety and tooling support.
Babel is a JavaScript compiler that allows you to use next-generation JavaScript, today. It can transform syntax from ES6/ES7 to ES5, making it compatible with older browsers. Babel focuses on enabling the use of modern JavaScript features, whereas CoffeeScript provides a different syntax altogether.
LiveScript is a language that compiles to JavaScript and is a fork of CoffeeScript. It aims to provide a more powerful and flexible syntax, including features like pattern matching and function composition. LiveScript is more experimental compared to CoffeeScript.
{
} } {
{ { } }
} }{ {
{ }{ } } _____ __ __
{ }{ }{ { } / ____| / _|/ _|
.- { { } { }} -. | | ___ | |_| |_ ___ ___
( { } { } { } } ) | | / _ \| _| _/ _ \/ _ \
|`-..________ ..-'| | |___| (_) | | | || __/ __/
| | \_____\___/|_| |_| \___|\___|
| ;--.
| (__ \ _____ _ _
| | ) ) / ____| (_) | |
| |/ / | (___ ___ _ __ _ _ __ | |_
| ( / \___ \ / __| '__| | '_ \| __|
| |/ ____) | (__| | | | |_) | |_
| | |_____/ \___|_| |_| .__/ \__|
`-.._________..-' | |
|_|
CoffeeScript is a little language that compiles into JavaScript.
Once you have Node.js installed:
npm install --global coffeescript
Leave off the --global
if you don’t wish to install globally.
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
FAQs
Unfancy JavaScript
The npm package coffee-script receives a total of 589,203 weekly downloads. As such, coffee-script popularity was classified as popular.
We found that coffee-script demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.