CommonJS
外观
CommonJS是一个项目,其目标是为JavaScript在网页浏览器之外建立模块约定。创建这个项目的主要原因是当时缺乏普遍可接受形式的JavaScript脚本模块单元,使它在与运行JavaScript脚本的常规网页浏览器所提供的不同的环境下可以重复使用。
历史
这个项目由Mozilla工程师Kevin Dangoor于2009年1月发起,最初名为ServerJS引用错误:没有找到与<ref>
对应的</ref>
标签。有关规定在一个开放进程中被建立和认可。一个规定只有在已经被多个实现完成之后才被认为是最终的[1]。 CommonJS不隶属于致力ECMAScript的Ecma International工作组 TC39,但是TC39的一些成员参与了这个项目[2]。
在2013年5月,Node.js包管理器npm的作者Isaac Z. Schlueter,声称Node.js已经废弃了CommonJS,Node.js核心开发者应避免使用[3]。
规定
规定列表包括[4]:
当前
- Modules/1.0 (被Modules/1.1取代)
- Modules/1.1
- Modules/1.1.1
- Packages/1.0
- Promises/B
- Promises/C
- System/1.0
提议
- Binary/B
- Binary/F
- Console
- Encodings/A
- Filesystem/A
- Filesystem/A/0
- Modules/Async/A
- Modules/Transport/B
- Packages/1.1
- Packages/Mappings
- Unit Testing/1.0
实现
- Akshell[5]
- Common Node[6]
- CommonJS Compiler - a command-line tool that makes Common JS modules suitable for in-browser use[7]
- CommonJS for PHP - a light-weight CommonJS implementation for PHP 5.3+[8]
- CouchDB[9]
- Flusspferd[10]
- GPSEE[11]
- Jetpack
- Joyent Smart Platform[12]
- JSBuild[13]
- MongoDB[14]
- Narwhal (JavaScript platform)[15]
- Node.js[16]
- Persevere[17]
- PINF JavaScript Loader[18]
- RingoJS[19]
- SilkJS[20]
- SproutCore[21]
- TeaJS[22]
- Wakanda[23]
- XULJet[24]
参见
- 服务器端JavaScript实现列表
- 文档对象模型 (DOM),网页浏览器客户端应用程序接口 (API),通常以JavaScript获得
- JSGI
引用
- ^ ProposalProcess - CommonJS Spec Wiki
- ^ CommonJS: the First Year - Blue Sky On Mars
- ^ Schlueter, Isaac Z. Forget CommonJS. It's dead. **We are server side JavaScript.**. GitHub. 25 Mar 2013.
- ^ JavaScript Standard Library. CommonJS. [2012-09-21].
- ^ Server-side JavaScript development and hosting - Akshell
- ^ olegp/common-node @ GitHub
- ^ - GitHub
- ^ DrBenton/CommonJSForPHP - GitHub
- ^ Implementations/CouchDB - CommonJS Spec Wiki
- ^ Flusspferd - CommonJS platform | Javascript bindings for C
- ^ Implementations/GPSEE - CommonJS Spec Wiki
- ^ Implementations/Smart - CommonJS Spec Wiki
- ^ Homepage - JSBuild 互联网档案馆的存檔,存档日期2011-01-04.
- ^ MongoDB
- ^ Implementations/Narwhal - CommonJS Spec Wiki
- ^ Implementations/node.js - CommonJS Spec Wiki
- ^ Implementations/Persevere - CommonJS Spec Wiki
- ^ pinf/loader-js - GitHub
- ^ Implementations/RingoJS - CommonJS Spec Wiki
- ^ SilkJS WWW Site
- ^ Implementations/SproutCore - CommonJS Spec Wiki
- ^ Implementations/TeaJS - CommonJS Spec Wiki
- ^ Wakanda
- ^ xuljet - XUL JavaScript Enhanced Toolkit - Google Project Hosting