Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

amd-optimizer

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amd-optimizer

Find all the dependencies of one or more amd modules and sort them in the correct order, from leaf (module with no dependencies) to root (module which no other module depends on). This is an alternative to the official requireJS optimizer, but is designed

  • 0.5.1
  • Source
  • npm
  • Socket score

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

amd-optimize

Find all the dependencies of one or more amd modules and sort them in the correct order, from leaf (module with no dependencies) to root (module which no other module depends on). This is an alternative to the official requireJS optimizer, but is designed as a library, not a stand alone application.

Things it can and can't do

  • find dependencies of a module
  • name anonymous modules
  • sort modules from leaf to root
  • produce source-maps
  • use require config
    • use paths
    • use package
    • use map
  • relative dependencies
  • exclude modules and paths
  • umd/iife declarations
  • commonJS style define
  • plugins

UMD

This project tries to find top-level define() calls. If you call it with the option umd: true then it will try to find umd modules where the define call is not top-level. But to accept the define call it will need to be wrapped in an AMD test, like most of the examples on the UMD page. The define call in the following code will be found, and, if anonymous, will be named:

if (typeof define === 'function' && define.amd) {
  define(['b'], factory);
}

if (typeof define === 'function' && define['amd']) {
  define(['b'], factory);
}

factory(typeof define === 'function' && define.amd ? define : function(){});

FAQs

Package last updated on 09 Oct 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