# amd-loader

> Add the capability to load AMD (Asynchronous Module Definition) modules to node.js

Latest version **0.0.8** (published 2017-05-09) · 0 weekly downloads

## Install

```sh
npm install amd-loader
pnpm add amd-loader
yarn add amd-loader
bun add amd-loader
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.8 |
| Published | 2017-05-09 |
| First published | 2011-11-01 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.4.11 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 76 |
| Author | ajax.org B.V. |
| Maintainers | fjakobs |

## Links

- npm: https://www.npmjs.com/package/amd-loader
- Repository: https://github.com/ajaxorg/node-amd-loader
- Homepage: https://github.com/ajaxorg/node-amd-loader#readme
- Issues: https://github.com/ajaxorg/node-amd-loader/issues
- npm.io page: https://npm.io/package/amd-loader

## Recent versions

- 0.0.8 (latest) — 2017-05-09
- 0.0.7 — 2017-05-09
- 0.0.6 — 2017-05-09
- 0.0.5 — 2013-08-01
- 0.0.4 — 2012-03-05
- 0.0.3 — 2011-11-10
- 0.0.2 — 2011-11-02
- 0.0.1 — 2011-11-01

## README

AMD loader for node.js
======================

node-amd-loader adds the capability to load unmodified AMD (Asynchronous Module DefinitionAsynchronous Module Definition) from node.js applications.

Installation
------------

`node-amd-loader` can be easily installed using [npm](http://npmjs.org).

    npm install amd-loader
    
Before being able to load AMD modules the `amd-loader` module has to be required.

    require("amd-loader");
    
This needs to be done only once.

Features
--------

### load modules which use AMD define() ###

Load modules which are written using  AMD [define](http://wiki.commonjs.org/wiki/Modules/AsynchronousDefinition#define.28.29_function) from node.js node.

amd.js

```javascript
    define(function(require, exports, module) {
        exports.B = "B";
    });
```

main.js

```
    require("amd-loader");
    var amd = require("./amd");
```

### support requireJS asyncronous loading syntax ###

From within an AMD modules the async require syntax introduced by [requireJS](http://requirejs.org) can be used.

```javascript
    require(["fs"], function(fs) {
        fs.readFile(...);
    })
```

### support requireJS text plugin ###

From within an AMD module the requireJS text plugin is supported.

```javascript
    var readme = require("text!./readme.md");
```

Continuous Integration status
-----------------------------

This project is tested with [Travis CI](http://travis-ci.org)
[![Build Status](https://secure.travis-ci.org/ajaxorg/node-amd-loader.png)](http://travis-ci.org/ajaxorg/node-amd-loader)

Credits
-------

[Kris Zip](https://github.com/kriszyp) came up the the initial [idea](https://gist.github.com/650000) how to hijack the node module loading.

License
-------

MIT license. See the LICENSE file for details.

---
_Source: https://npm.io/package/amd-loader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
