Javascript - CommonJs

> (World Wide) Web - (W3|WWW) > Javascript (Js|ECMAScript)

1 - About

CommonJs is a Module format definition

The commonJS format is also used by Node.js. Therefore a commonJS module will run on node.

Advertising

3 - Module Statement

CommonJSModule.js
# require will import code from another module
var MyDependency = require('my-dependency');
 
# module.exports will make its property public 
module.exports = function() {};

where:

4 - Documentation / Reference

web/javascript/commonjs.txt · Last modified: 2019/02/16 17:40 by gerardnico