retidy
TypeScript icon, indicating that this package has built-in type declarations

1.5.1 • Public • Published

Retidy

GitHub stars npm npm downloads license

Extract, unminify, and beautify ("retidy") each file from a webpack/parcel bundle

⚠️ No Unit Tests, may have unexpected side effects ⚠️

Installation

npm install -g retidy

Usage

CLI

retidy \
    -i <bundle_file> \
    -o <out_dir> \
    -t <bundle_type> \
    -b <bundle_ast_reference>

see

retidy --help

API

import retidy from "retidy"

retidy(bundleCode[, options])
retidy(bundleCode: string, options?: Options): Promise<string[]>

If set options.writeFiles = true (by default), retidy will write extracted code files into the file system (under options.outDir directory, ./retidy-out/ by default).

Options

see src/options.ts

Example

import retidy from "retidy"
import fs from "fs"

const code = fs.readFileSync("path/to/webpack-bundle.js", "utf-8")

retidy(code, { type: "webpack", outDir: "./out/", bundleAstReferenceKeys: ["body", 0, "expression", "right"] })

License

MIT

Legal note

Some companies specify in their terms of service that their code cannot be "reverse engineered".
Hope you understand what you are doing so you don't break any agreements.

Package Sidebar

Install

npm i retidy

Weekly Downloads

2

Version

1.5.1

License

MIT

Unpacked Size

493 kB

Total Files

140

Last publish

Collaborators

  • xmader