Nodejitsu free for Open Source programFork me on GitHub

RequireJS Loader Plugins

RequireJS loader plugins

You can use native requirejs loader plugins (those that make sense in node?) just like any other module.

For example:

var myText = require('text!myTextFile.txt')

or

define(['json!myjson.json'], function(theJson){...})

On the nodejs side, uRequire uses RequireJS for node to load the plugin and let it do the actual loading work.

You can just put them on your bundleRoot and use them right away. For example to use "text!myText.txt" you 'll need to copy text.js on your bundleRoot, or put it in a folder relative to bundleRoot and note it on requirejs.config.json.

Only 2 plugins have been tried so far (text, json), but most that dont rely on browser features should work...