Fork me on GitHub

Ultimate Aims

The cautious Architect's intro

A Universal Module Converter

uRequire converts from AMD and/or nodejs module formats (or a hybrid) to either UMD, to pure AMD/nodejs or a combined .js that runs everywhere.

uRequire has built in support for coffeescript, Livescript, coco & iced-coffeescript (and its trivial to add others). It aims to simplify the authoring of code written in anything to run everywhere. Harmony modules will be added when mainstream parser support becomes available.

uRequire is using a flexible template system written in pure Coffeescript, that can do wonders, albeit simple. An average CS coder would need <30 minutes for a 10 liner template like 'nodejs'.

Boilerplate no more!

uRequire removes the mud from UMD, which is currently the only true option for cross-platform modular javascript development, but its ugly.

You will no longer need to add UMD around your non-modular code to AMDdify the deployment.

You will no longer need to fall to the travesty of concatanation of .js files to produce your final .js.

You are empowered to use modules to better structure your code during development and deploy in one simple step.

Keep it DRY!

Fix pains, Relax, 'Just do it'

The aim is to cater for (m)any format intricacies and fix (m)any common pains, problems and omissions from module definition formats.

uRequire provides the simplest possible authoring of modular javascript code with a relaxed dependencies structure for modules, using the 'good parts' from AMD and nodejs. It brings browser-side best practices (that appear to be AMD/requirejs) closer to nodejs. And vise versa.

It helps you have natural & flexible structuring and refactoring of javascript code.

Unlock and 'Do it just'

uRequire empowers code reuse & modularity without one-side locking.

The lost Java dream of cross-platform execution (that flopped on browser) is becoming true with JavaScript (the 10day toy language!, that won the browser and now nodejs takes Jobol to the server race. And then you have WinJS, appcelerator/mobile and who knows what in a few years!)

The aim is that when no browser/DOM or nodejs specifics are present, the same source code runs & tests on both browser and nodejs (and in hte future WinJS, Titanium and whatever:-).

You code is ready to be deployed on any environment (even a non-AMD Web/Script) with a simple build step.

Functionality injection

uRequire can generate code and inject it on modules. With flexible templates (& parsers), it can also convert code structure.

Popular standardized functionalities and structures like rootexports and noConflict() no longer have to be hand-crafted.

Using features like exports.bundle allows you to cleanly declare you bundle global-looking modules in one place, without poluting the global window object. The less code u write, the less errors and barriers!

Finally, you can deploy your code in one step to run either on node or browser as separate module files (development mode) or as one combined & optimized file, with or without AMD runtime.

uRequire empowers a form of declarative feature injection for modules.

Resource Conversion

uRequire has a unique in-memory resource conversion workflow / assets pipeline engine, that allows you to convert from any resource to any other, using an expressive, small and extensible declaration. See more in Resource Converters.

Module Manipulation

uRequire gives you the ability within the ResourceConversion process to Manipulate Modules before the final template conversion. With this facility you have a chance to

  • inject, replace or remove dependencies from your modules.

  • inject, replace or remove code fragments from your modules.