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

amd-unpack

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amd-unpack

extract modules from a bundled AMD project using define/require functions

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

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

amd-unpack

extract modules from a bundled AMD project using define/require functions

Install - Usage - API - License: Apache-2.0

npm travis standard

Install

npm install amd-unpack

Usage

Pipe a bundle to it:

$ amd-unpack < bundle.js
[
{"id":0,"source":"exports.test=function(t){console.log(t)},exports.boop=\"beep\"","deps":{}}
,
{"id":1,"source":"var n,r,o=module.exports={};/*..snip..*/","deps":{}}
,
{"id":2,"source":"(function(t){function n(t,e){for(var n=0,r=t.length-1;r>=0;r--){var /*..snip..*/","deps":{"1":1}}
,
{"id":3,"source":"var r=require('a');require('b').test(r.join(\"whatever\",\"lol\"))","deps":{"a":0,"b":2}}
]

The output is a JSON array in the module-deps format.

The output is rewritten to the CJS format:

// input
define(['a', 'b'], function (c, d) {
  // xyz
  return z
})

// output
var c = require('a')
var d = require('b')

module.exports = (function () {
  // xyz
  return z
}())

API

var unpack = require('amd-unpack')

var modules = unpack(source)

Return an array of module-deps objects from the bundle source string source.

License

Apache-2.0

Keywords

FAQs

Package last updated on 11 Jul 2019

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