CommonJS
外观
CommonJS是一个项目,其目标是为JavaScript在网页浏览器之外建立模块约定。创建这个项目的主要原因是当时缺乏普遍可接受形式的JavaScript脚本模块单元,使它在与运行JavaScript脚本的常规网页浏览器所提供的不同的环境下可以重复使用。
历史
这个项目由Mozilla工程师Kevin Dangoor于2009年1月发起,最初名为ServerJS[1]。在2009年8月,这个项目被改名为“CommonJS”来展示其API的可广泛应用性[2]。有关规定在一个开放进程中被建立和认可,一个规定只有在已经被多个实现完成之后才被认为是最终的[3]。 CommonJS不隶属于致力ECMAScript的Ecma国际l工作组 TC39,但是TC39的一些成员参与了这个项目[4]。
在2013年5月,Node.js包管理器npm的作者Isaac Z. Schlueter,声称Node.js已经废弃了CommonJS,Node.js核心开发者应避免使用[5]。
规定
规定列表包括[6]:
当前
- 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[7]
- Common Node[8]
- CommonJS Compiler - a command-line tool that makes Common JS modules suitable for in-browser use[9]
- CommonJS for PHP - a light-weight CommonJS implementation for PHP 5.3+[10]
- CouchDB[11]
- Flusspferd[12]
- GPSEE[13]
- Jetpack
- Joyent Smart Platform[14]
- JSBuild[15]
- MongoDB[16]
- Narwhal (JavaScript platform)[17]
- Node.js[18]
- Persevere[19]
- PINF JavaScript Loader[20]
- RingoJS[21]
- SilkJS[22]
- SproutCore[23]
- TeaJS[24]
- Wakanda[25]
- XULJet[26]
参见
- 服务器端JavaScript实现列表
- 文档对象模型 (DOM),网页浏览器客户端应用程序接口 (API),通常以JavaScript获得
- JSGI
引用
- ^ What Server Side JavaScript needs - Blue Sky On Mars
- ^ CommonJS: JavaScript Standard Library
- ^ 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