Skip to content

kgriffs/node-use

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Use.js

DRY version of require() for Node.js

Installation

npm install use

Example

eval(require('use')(
  'util', 
  'http',
  'https',
  'url',
  'path',
  'stream',

  'xregexp#XRegExp',

  './helper'
));

util.debug('Easy as pie...');

XRegExp.replace(
  'x-key-lime', 
  XRegExp('\\b\\w', 'g'), 
  function(match) { 
    return match.toUpperCase();
  }
);

helper.doSomethingGrand();

Warning

This module does not work in strict mode. Only enable strict mode, if you need it, after the eval statement.

About

DRY version of the require() function used in Node.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published