Metadata-Version: 2.4
Name: bundle-parser
Version: 0.1.0
Summary: Universal JS bundle extractor: routes, API endpoints, UI strings, i18n keys, source maps
License-Expression: MIT
Project-URL: Homepage, https://github.com/Chernousan/js-bundle-extractor
Project-URL: Repository, https://github.com/Chernousan/js-bundle-extractor.git
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: pyjsparser>=2.7.1

# bundle-parser

Universal JS bundle extractor for routes, API endpoints, UI strings, i18n keys, and source maps.

## Install

```bash
pip install .
```

## Use

### Command Line

```bash
bundle-parser path/to/bundle.js [output.json]
```

Example:
```bash
bundle-parser app.min.js report.json
```

### Python API

```python
from bundle_parser import parse_bundle_file

report = parse_bundle_file('app.min.js')

print("Bundler:", report.detection['bundler'])
print("Routes:", report.extraction['routes'])
print("API Endpoints:", report.extraction['api_endpoints'])
print("UI Strings:", report.extraction['ui_strings'])
print("Confidence:", report.confidence)
```

## Example Output

```json
{
  "detection": {
    "bundler": "webpack",
    "obfuscation": "partial",
    "has_source_map": true,
    "is_split_chunks": true,
    "detector_confidence": 0.92
  },
  "extraction": {
    "routes": ["/api/users", "/api/posts", "/dashboard"],
    "ui_strings": ["Welcome", "Loading...", "Error"],
    "ui_elements": ["Button", "Form", "Modal"],
    "api_endpoints": ["https://api.example.com/v1/users", "https://api.example.com/v1/posts"],
    "i18n_keys": ["common.welcome", "common.error"],
    "source_maps": ["app.min.js.map"],
    "chunks": ["app.chunk1.js", "app.chunk2.js"],
    "counts": {
      "routes": 3,
      "ui_strings": 3,
      "ui_elements": 3,
      "api_endpoints": 2,
      "i18n_keys": 2,
      "source_maps": 1,
      "chunks": 2
    }
  },
  "confidence": 0.87
}
```

## What it provides

- `bundle_parser.parse_bundle_file(...)` for programmatic use
- `bundle-parser` console script for CLI runs

## Dependencies

- `pyjsparser>=2.7.1`
