JavaScript is a powerful object-oriented language, and it has many fast and efficient interpreters. The official JavaScript standard defines the API for building browser-based applications. However, it is not set in a standard library for a wider range of applications.
The CommonJS API fills this gap by defining APIs that are used by many common applications, primarily non-browser applications . Its ultimate goal is to provide a library of standards like Python,Ruby and Java . In this way, developers can write applications using the CommonJS API , which can then be run in different JavaScript interpreters and different host environments. In a system compatible with CommonJS , you can develop a practical JavaScript Program:
Server-side JavaScript Applications
Command-line tools
Graphical interface Applications
Hybrid applications (e.g.,Titanium or Adobe AIR)
the relationship between NodeJS and CommonJS
CommonJS is a specification,NodeJS is the implementation of this specification. CommonJS is an evolving norm and the plan will include the following parts:
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
Customized progress for each sub-specification please see the official website for instructions:http://commonjs.org/specs/
CommonJS has many implementations, many of which are famous, such as:Apache CouchDB and node. js and so on. But most of these projects only implement Part of the CommonJS specification. Specific project and implementation section see the official website for instructions:http://commonjs.org/impl/
Don't underestimate it as a background app.JavaScript,Palmof theWebOSDevelopment plan mentioned in theCommonJSand its extendedJS API, and almost all of the platforms, including the smartphone platform and the computer platform, began to introduceWebtechnology: for exampleS60in theWRT,IPhonein theWebwidget,Androidon the platformWebwidget, there areFirefoxdirectly withXMLand theCSSused for InterfaceJavascriptcontrol logic, evenGoogleof theChromeOSis directly a browser operating system. I make a technical bet: Dynamic language and static language mixed programming will be very popular (e.g.Androidand thePalmwebosThe introduction of twoSDK,QTuntilQtscript).
Life Thunder Dog---node. js---3commonJs and Nodejs