reqs
v0.5.5
Published
alias for node.js require
Downloads
3
Maintainers
Readme
reqs v0.5.5
alias for node.js require
Examples
CoffeeScript:
# load reqs package into a local var ($, _, r, o, etc.)
$ = require 'reqs'
# or register it as a global var (default: '$')
require('reqs').register()
# now you can neatly load packages
crystal =$ 'crystal'
http =$ 'http'
zlib =$ 'zlib'
# or just use them inline
if $('fs').existsSync 'test.txt'
console.log 'File exists.'
# you can also load multiple packages into a local var
reqs =$ ['crystal','http','zlib']
reqs.crystal # crystal package
# which can also be used to preload a package before using it inline
$ ['crystal','http','zlib']
$('crystal') # already loaded
# load single/multiple packages as global vars
$.global 'crystal'
$.global ['crystal','http','zlib']
JavaScript:
// load reqs package into a local var ($, _, r, o, etc.)
var $ = require('reqs');
// or register it as a global var (default: '$')
require('reqs').register();
// now you can neatly load packages
var crystal = $('crystal');
var http = $('http');
var zlib = $('zlib');
// or just use them inline
if ($('fs').existsSync('test.txt')) {
console.log('File exists.');
}
// you can also load multiple packages into a local var
var reqs = $(['crystal','http','zlib']);
reqs.crystal // crystal package
// which can also be used to preload a package before using it inline
$(['crystal','http','zlib']);
$('crystal') // already loaded
// load single/multiple packages as global vars
$.global('crystal');
$.global(['crystal','http','zlib']);