官术网_书友最值得收藏!

The CommonJS initiative

In 2009, a Mozilla engineer named Kevin Dangoor realized that server-side JavaScript needed a lot of help in order to be useful. The concept of server-side JavaScript had already existed, but wasn't very popular due to a number of limitations, particularly in terms of the JavaScript ecosystem.

In a blog post written in January of 2009, Dangoor cited a few examples of where JavaScript needed some help. He wrote that the JavaScript ecosystem would need a standard library and standard interfaces for things such as file and database access. Additionally, the JavaScript environment needed a way to package, publish, and install libraries and dependencies for others to use, and also needed a package repository to host all of the aforementioned.

Out of all of this came the CommonJS initiative, whose most notable contribution to the JavaScript ecosystem is the CommonJS module format. If you've done any work with Node.js, you're probably already familiar with CommonJS: your package.json file is written in the CommonJS modules package specification format, and writing code like var app = require(‘./app.js’) in one file with module.exports = App in app.js is using the CommonJS module specification.

The standardization of modules and packages paved the way for a significant boost in JavaScript popularity. Developers were now able to use modules to write complex applications spanning many files, without polluting the global namespace. Package and library developers were able to build and publish new libraries of higher levels of abstraction than JavaScript's standard library. Node.js and npm would shortly grab onto these concepts and build a major ecosystem around package sharing.

主站蜘蛛池模板: 读书| 乌鲁木齐市| 元谋县| 扶沟县| 平武县| 临高县| 汝州市| 寿光市| 金寨县| 全南县| 三明市| 东乌珠穆沁旗| 海丰县| 抚州市| 建阳市| 阜新| 禄劝| 大邑县| 永嘉县| 南涧| 章丘市| 广汉市| 法库县| 奉新县| 德昌县| 石楼县| 遂溪县| 盐山县| 鄂伦春自治旗| 平顶山市| 荔浦县| 始兴县| 大理市| 西宁市| 米泉市| 辛集市| 如东县| 武强县| 安泽县| 马公市| 太白县|