代码改变世界

CommonJS规范

2016-03-03 18:01  youxin  阅读(270)  评论(0编辑  收藏  举报
CommonJS是一种规范,NodeJS是这种规范的实现。CommonJS是一 个不断发展的规范,计划将要包括如下部分:
  • Modules
  • Binary strings and buffers
  • Charset encodings
  • Binary, buffered, and textual input and output (io) streams
  • System process arguments, environment, and streams
  • File system interface
  • Socket streams
  • Unit test assertions, running, and reporting
  • Web server gateway interface, JSGI
  • Local and remote packages and package management

具体每个子规范的定制进度请查看官方网站的说明:http://commonjs.org/specs/

CommonJS有很多实现,其中不乏很多大名鼎鼎的项目,比如 说:Apache的CouchDBnode.js等。但这些项目大 部分只实现了CommonJS的部分规范。具体的项目和实现部分参见官方网站的说明:http://commonjs.org/impl/
 
 
 
参考;
http://www.ruanyifeng.com/blog/2012/10/asynchronous_module_definition.html