且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

CoffeeScript 1.4.0发布

更新时间:2022-08-14 20:56:08

CoffeeScript 1.4.0发布。CoffeeScript是一种编程语言,它编写的代码可以编译成JavaScript。CoffeeScript需要Node.js的支持,这一切与微软新推出的TypeScript很相似。


要安装CoffeeScript,需要先安装Node.js,然后使用Node.js的包管理器npm安装CoffeeScript:
[javascript] view plaincopyprint?
  1. npm install -g coffee-script  

执行CoffeeScript脚本:
[javascript] view plaincopyprint?
  1. coffee /path/to/script.coffee  

编译CoffeeScript脚本:
[javascript] view plaincopyprint?
  1. coffee -c /path/to/script.coffee  

查看CoffeeScript的官方文档,见:http://coffeescript.org/


作者:chszs,转载需注明。作者博客主页:http://blog.csdn.net/chszs


CoffeeScript源码主页:https://github.com/jashkenas/coffee-script


CoffeeScript 1.4.0在代码调试方面有很大的增强,简化了调试工作。

CoffeeScript 1.4.0版的主要变化:

1. The CoffeeScript compiler now strips Microsoft's UTF-8 BOM if it exists, allowing you to compile BOM-borked source files.

2. Fix Node/compiler deprecation warnings by removing registerExtension, and moving from path.exists to fs.exists.

3. Small tweaks to splat compilation, backticks, slicing, and the error for duplicate keys in object literals.