Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including unamd with all npm packages installed. Try it out:

var unamd = require("unamd")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

unamd v1.0.3

browserify v2 plugin for transforming AMD to CommonJS.

unAMD

Transform AMD files to CommonJS format.

Usage

browserify -t unamd source.js -o dest.js

or

browserify -t [unamd --log] source.js -o dest.js

in order to console.log which files are being transformed.

If you want to do further piping, you probably don't want to use the --log option.

Configuration

In package.json, add browserify.unamd["require.conf"] property. It will use that to read the "paths" and "baseUrl".

{
    "name": "your-project",
    "version": "0.0.0",
    "browserify": {
        "unamd": {
            "require.conf": "src/js/require.conf"
        }
    }
}

Just in case, you can configure "baseUrl" for yourself:

{
    "name": "your-project",
    "version": "0.0.0",
    "browserify": {
        "unamd": {
            "require.conf": "src/js/require.conf",
            "baseUrl": "src/js"
        }
    }
}

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free