在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:js2coffee/js2coffee开源软件地址:https://github.com/js2coffee/js2coffee开源编程语言:CoffeeScript 94.6%开源软件介绍:Compile JavaScript into CoffeeScript. This 2.0 release is a complete rewrite featuring a better parser (Esprima). See what's new in 2.0 for an overview of new features and consult the migration guide for info on updating from 0.x. InstallAvailable on npm and bower. npm install --global js2coffee
js2coffee --help Also available via CDN (
Command lineThe command line utility accepts both filenames or stdin. $ js2coffee file.js [file2.js ...]
$ cat file.js | js2coffee JavaScript APIAvailable via npm ( result = js2coffee.build(source);
result.code // code string
result.ast // transformed AST
result.map // source map
result.warnings // array of warnings Errors are in this format: catch (e) {
e.message // "index.js:3:1: Unexpected INDENT\n\n 3 var\n ---^"
e.description // "Unexpected INDENT"
e.start // { line: 1, column: 4 }
e.end // { line: 1, column: 10 }
e.sourcePreview // '...'
} Warnings are in this format: result.warnings.forEach((warn) => {
warn.description // "Variable 'x' defined twice
warn.start // { line: 1, column: 4 }
warn.end // { line: 1, column: 9 }
warn.filename // "index.js"
}) Docs
Thanksjs2coffee © 2012+, Rico Sta. Cruz. Released under the MIT License. Maintainers:
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论