New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

amidala

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amidala

Asynchronous AMD loading of CommonJS modules (no build step)

  • 1.0.0
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

Asynchronous CommonJS/AMD Loader

This module loads NPM modules (CommonJS) as AMD modules.

Unlike RequireJS, which requires a monolithic compile step and returns a single bundle, this loader loads each file separately. This makes development/debugging easier, because your modules are not all munged together.

Usage

// Dynamic loading - location is arbitrary
app.use('/amd/', amd.dynamic());
<script src="/amd/"></script>
<script>
    require('uri-templates', function (UriTemplate) {
        ...
    });
</script>

Explicit loading position

By default, the AMD loader script figures out where to load modules from by inspecting its own URL.

If this doesn't work (i.e. the loader script is itself being loaded dynamically), then you'll need to explicitly tell it where it's being hosted.

// Dynamic loading, based in arbitrary location
app.use('/amd/', amd.dynamic('/amd/'));

FAQs

Package last updated on 14 Apr 2016

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc