Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/goto-bus-stop/webpack-unpack
extract modules from a bundle generated by webpack
https://github.com/goto-bus-stop/webpack-unpack
Last synced: 27 days ago
JSON representation
extract modules from a bundle generated by webpack
- Host: GitHub
- URL: https://github.com/goto-bus-stop/webpack-unpack
- Owner: goto-bus-stop
- License: other
- Created: 2018-06-23T13:04:40.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-08-03T04:53:47.000Z (over 3 years ago)
- Last Synced: 2024-10-05T16:01:24.818Z (about 1 month ago)
- Language: JavaScript
- Size: 28.3 KB
- Stars: 48
- Watchers: 2
- Forks: 8
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# webpack-unpack
extract modules from a bundle generated by webpack
[![npm][npm-image]][npm-url]
[![travis][travis-image]][travis-url]
[![standard][standard-image]][standard-url][npm-image]: https://img.shields.io/npm/v/webpack-unpack.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/webpack-unpack
[travis-image]: https://img.shields.io/travis/goto-bus-stop/webpack-unpack.svg?style=flat-square
[travis-url]: https://travis-ci.org/goto-bus-stop/webpack-unpack
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
[standard-url]: http://npm.im/standard## Install
```
npm install webpack-unpack
```## Usage
Pipe a bundle to it:
```js
$ webpack-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(2);require(0).test(r.join(\"whatever\",\"lol\"))","deps":{"0":0,"2":2}}
]
```The output is a JSON array in the [module-deps][] format.
## API
```js
var unpack = require('webpack-unpack')
```### `var modules = unpack(source)`
Return an array of [module-deps][] objects from the bundle source string `source`.
## License
[Apache-2.0](LICENSE.md)
[module-deps]: https://github.com/browserify/module-deps#output-objects