Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
extract modules from a bundled AMD project using define/require functions
extract modules from a bundled AMD project using define/require functions
Install - Usage - API - License: Apache-2.0
npm install amd-unpack
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
}())
var unpack = require('amd-unpack')
var modules = unpack(source)
Return an array of module-deps objects from the bundle source string source
.
0.2.0
FAQs
extract modules from a bundled AMD project using define/require functions
The npm package amd-unpack receives a total of 0 weekly downloads. As such, amd-unpack popularity was classified as not popular.
We found that amd-unpack demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.