captainbrosset/cleanjs — Issue #31: Requiring modules in node.js
Author: piuccio
Created: 2012-02-05 14:44:02+00:00
State: open

This is a bit tricky, but in node.js it's good practice, when loading a module, to use as variable name the module identifier.

For instance

var fs = require("fs");

cleanjs complains that `Name fs doesn't mean anything`.

The rule should be, if we're using commonjs modules 1.1

anyUglyVariableName = require(moduleId)

should be fine as long as `anyUglyVariableName` equals `moduleId`