Top "Commonjs" questions

CommonJS is a project whose goal is to move JavaScript outside the browser.

module.exports vs exports in Node.js

I've found the following contract in a Node.js module: module.exports = exports = nano = function database_module(cfg) {...} I wonder …

javascript node.js commonjs
Relation between CommonJS, AMD and RequireJS?

I'm still very confused about CommonJS, AMD and RequireJS, even after reading a lot. I know that CommonJS (formerly ServerJS) …

javascript module requirejs amd commonjs
Field 'browser' doesn't contain a valid alias configuration

I've started using webpack2 (to be precise, v2.3.2) and after re-creating my config I keep running into an issue I …

npm webpack commonjs webpack-2 package.json
Node.js - use of module.exports as a constructor

According to the Node.js manual: If you want the root of your module's export to be a function (such …

javascript node.js commonjs
Difference between "module.exports" and "exports" in the CommonJs Module System

On this page (http://docs.nodejitsu.com/articles/getting-started/what-is-require), it states that "If you want to set the exports …

javascript node.js commonjs
How to check whether a script is running under Node.js?

I have a script I am requiring from a Node.js script, which I want to keep JavaScript engine independent. …

javascript node.js commonjs
module.exports "Module is not defined"

So, I am using RequireJS and React, trying to load a third-party component, which has been installed with: npm install …

javascript requirejs reactjs commonjs
Webpack and external libraries

I’m trying out webpack (http://webpack.github.io/) and it looks really nice, however I’m kind of stuck …

javascript require commonjs webpack
module.exports in typescript

does somebody know how to do a module.exports? I tried some different ways ending up with export class Greeter {} …

typescript import commonjs
Babel 6 changes how it exports default

Before, babel would add the line module.exports = exports["default"]. It no longer does this. What this means is before …

ecmascript-6 commonjs babeljs