Metadata-Version: 2.1
Name: sawari
Version: 1.0.6
Summary: extract URLs, strings, and more from JavaScript code
License: MIT
Author: Shuaib Oladigbolu
Author-email: shuaib@footstep.ninja
Requires-Python: >=3.11,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: argcomplete (>=3.2.0,<4.0.0)
Requires-Dist: beautifulsoup4 (>=4.14.3,<5.0.0)
Requires-Dist: html5-parser (>=0.4.12,<0.5.0)
Requires-Dist: html5lib (>=1.1,<2.0)
Requires-Dist: lxml (>=5.3.0,<6.0.0)
Requires-Dist: tree-sitter (>=0.25.2,<0.26.0)
Requires-Dist: tree-sitter-javascript (>=0.25.0,<0.26.0)
Description-Content-Type: text/markdown

# ṣàwárí
> ṣàwárí (ṣe àwárí) means 'to discover, explore, or search' in Yorùbá

Extract URLs, strings, and more from JavaScript code using tree-sitter.

## Features
- **URLs Mode** - Extract API endpoints, URLs, and paths with intelligent variable resolution
- **Strings Mode** - Extract all string literals and template strings
- **Tree Mode** - Visualize Abstract Syntax Tree structure
- **Inspect Mode** - Discover node types and code patterns
- **Query Mode** - Custom tree-sitter queries for pattern matching

## Installation
**ṣàwárí** requires at least Python 3.11

```bash
pip install sawari
```

## Usage
Read more in the [documentation](docs/)

### Extract URLs and API endpoints
```bash
sawari urls app.js --include-templates
sawari urls bundle.js --context '{"API_URL":"https://api.example.com"}'
```

### Find potential secrets
```bash
sawari strings app.js --min 20 | grep -i "key\|token\|secret"
```

### Visualize code structure
```bash
sawari tree app.js --only-named
```

### Custom pattern matching
```bash
sawari query app.js --query '(function_declaration name: (identifier) @name)'
```

## Related Tools
- [LinkFinder](https://github.com/GerbenJavado/LinkFinder)
- [jsluice](https://github.com/BishopFox/jsluice/tree/main/cmd/jsluice)

## License

[MIT](LICENSE.md)

