Socket
Socket
Sign inDemoInstall

amd-loader

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    amd-loader

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


Version published
Weekly downloads
8.3K
decreased by-45.77%
Maintainers
1
Install size
9.68 kB
Created
Weekly downloads
 

Readme

Source

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.

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 from node.js node.

amd.js

    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 can be used.

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

support requireJS text plugin

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

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

Continuous Integration status

This project is tested with Travis CI Build Status

Credits

Kris Zip came up the the initial idea how to hijack the node module loading.

License

MIT license. See the LICENSE file for details.

FAQs

Last updated on 09 May 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc