https://github.com/roccomuso/upx
Node.js cross-platform wrapper for UPX - the ultimate packer for eXecutables.
https://github.com/roccomuso/upx
binaries compression executable js nodejs upx wrapper
Last synced: about 1 month ago
JSON representation
Node.js cross-platform wrapper for UPX - the ultimate packer for eXecutables.
- Host: GitHub
- URL: https://github.com/roccomuso/upx
- Owner: roccomuso
- Created: 2017-08-01T17:59:55.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-02-22T10:26:30.000Z (over 6 years ago)
- Last Synced: 2024-12-28T21:35:18.913Z (10 months ago)
- Topics: binaries, compression, executable, js, nodejs, upx, wrapper
- Language: JavaScript
- Homepage:
- Size: 1.97 MB
- Stars: 35
- Watchers: 3
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# upx
[](https://www.npmjs.com/package/upx)
[](https://david-dm.org/roccomuso/upx)
[](https://standardjs.com)> Node cross-platform wrapper for [UPX](https://github.com/upx/upx)
## Install
$ npm install --save upx
## Usage
```javascript
const UPX = require('upx')(opts) // see options belowUPX('Hello.exe')
.output('Compressed.exe')
.start().then(function(stats){
/* stats:
{ cmd: 'compress',
name: 'Compressed.exe',
fileSize: { before: '1859072', after: '408064' },
ratio: '21.95%',
format: 'win32/pe',
affected: 1 }
*/
}).catch(function (err) {
// ...
})
```### Methods
**`upx()`** : path is the absolute path to the file to compress/decompress.
**`.output()`** : path to the output file.
**`.start()`** : Start the compress/decompress process.
### Options
The options below can be true or false.
| Option | Description |
|--------|-------------|
| `faster` | compress faster |
| `better` | compress better |
| `best` | compress best (can be slow for big files) |
| `decompress` | decompress |
| `list` | list compressed files |
| `force` | force compression of suspicious files |
| `brute` | try all available compression methods & filters (slow) |
| `ultraBrute` | try even more compression variants (very slow) |
| `overlayCopy` | copy any extra data attached to the file (default) |
| `overlayStrip` | strip any extra data attached to the file (dangerous) |
| `overlaySkip` | don't compress a file with an overlay |
| `8086` | make compressed sys work on any 8086 (for dos) |
| `noReloc` | put no relocations in to the exe header (for dos) |
| `8bit` | uses 8 bit size compression (default: 32 bit) |
| `8mibRam` | 8 megabyte memory limit (default 2MiB) |## Debug
set the env DEBUG: `DEBUG=upx node myScript.js`
# Author
Rocco Musolino ([@roccomuso](https://twitter.com/roccomuso))
# License
MIT