MCPcopy Index your code
hub / github.com/Xmader/retidy

github.com/Xmader/retidy @v1.0.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0.1 ↗ · + Follow
188 symbols 585 edges 38 files 0 documented · 0% updated 5y ago★ 523 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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.

Extension points exported contracts — how you extend this code

PrintResultType (Interface)
(no doc) [3 implementers]
src/generator/printer.ts
Options (Interface)
(no doc)
src/options.ts
Transformer (Interface)
(no doc)
src/utils/visitor-wrapper.ts
Module (Interface)
(no doc)
src/extractor/module.ts
Options (Interface)
(no doc)
src/generator/options.ts
ExtractResult (Interface)
(no doc)
src/extractor/extractor-utils.ts
LineInfo (Interface)
(no doc)
src/generator/printer.ts
Extractor (Interface)
(no doc)
src/extractor/extractor-utils.ts

Core symbols most depended-on inside this repo

call
called by 270
src/generator/fast-path.ts
concat
called by 159
src/generator/lines.ts
fromString
called by 113
src/generator/lines.ts
join
called by 48
src/generator/lines.ts
map
called by 42
src/generator/fast-path.ts
getValue
called by 31
src/generator/fast-path.ts
slice
called by 21
src/generator/lines.ts
indent
called by 20
src/generator/lines.ts

Shape

Function 105
Method 60
Interface 17
Class 6

Languages

TypeScript100%

Modules by API surface

src/generator/lines.ts40 symbols
src/generator/printer.ts31 symbols
src/generator/fast-path.ts22 symbols
src/generator/patcher.ts16 symbols
src/generator/util.ts14 symbols
src/generator/comments.ts11 symbols
src/extractor/parcel/extract-modules.ts4 symbols
src/utils/visitor-wrapper.ts3 symbols
src/transforms/add-parentheses-for-binary-expressions.ts3 symbols
src/index.ts3 symbols
src/generator/options.ts3 symbols
src/extractor/parcel/solve-modules.ts3 symbols

For agents

$ claude mcp add retidy \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page