Top "Commonjs" questions

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

Typescript compiler error when importing json file

So the code is simple: calls.json {"SERVER":{ "requests":{ "one":"1" } } } file.ts import json = require('../static/calls.json'); console.…

javascript json node.js typescript commonjs
TypeScript error in Angular2 code: Cannot find name 'module'

I have defined the following Angular2 component: import {Component} from 'angular2/core'; @Component({ selector: 'my-app', moduleId: module.id, templateUrl: './…

typescript angular commonjs
RequireJS: How to define modules that contain a single "class"?

I have a number of JavaScript "classes" each implemented in its own JavaScript file. For development those files are loaded …

javascript commonjs requirejs
How can I 'require' CommonJS modules in the browser?

What is the best way to load CommonJS modules as client-side JavaScript code in the browser? CommonJS modules put their …

javascript node.js commonjs
Load "Vanilla" Javascript Libraries into Node.js

There are some third party Javascript libraries that have some functionality I would like to use in a Node.js …

javascript node.js commonjs
Structuring a NodeJS module - variables and methods

I want to create modules to structure my NodeJS application, but I'm a little lost, and I haven't found anything (…

javascript node.js closures commonjs
nodeJS require.paths resolve problem

I am trying to require a file relatively and mysteriously the following is happening This works well which points to /…

javascript node.js relative-path require commonjs
Asynchronous JavaScript - Callbacks vs Deferred/Promise

Possible Duplicate: What are the differences between Deferred, Promise and Future in Javascript? Lately I've been making an effort to …

javascript jquery-deferred commonjs
How to handle circular dependencies with RequireJS/AMD?

In my system, I have a number of "classes" loaded in the browser each a separate files during development, and …

javascript commonjs requirejs