Skip to main content

extract URLs, strings, and more from JavaScript code

Project description

ṣà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

pip install sawari

Usage

Read more in the documentation

Extract URLs and API endpoints

sawari urls app.js --include-templates
sawari urls bundle.js --context '{"API_URL":"https://api.example.com"}'

Find potential secrets

sawari strings app.js --min 20 | grep -i "key\|token\|secret"

Visualize code structure

sawari tree app.js --only-named

Custom pattern matching

sawari query app.js --query '(function_declaration name: (identifier) @name)'

Related Tools

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sawari-1.0.5.tar.gz (54.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sawari-1.0.5-py3-none-any.whl (63.6 kB view details)

Uploaded Python 3

File details

Details for the file sawari-1.0.5.tar.gz.

File metadata

  • Download URL: sawari-1.0.5.tar.gz
  • Upload date:
  • Size: 54.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.9 Darwin/21.6.0

File hashes

Hashes for sawari-1.0.5.tar.gz
Algorithm Hash digest
SHA256 6ec1e1b28f444929ac2e9a59f84d6a8bc1762c07318c3d90c22ee070e6ac3959
MD5 3d01759c8a8be899024994a211b0f7cc
BLAKE2b-256 f3d989c4cce5554597e96f7e7a8a864d9d39298f31294e994ee79689b28f5307

See more details on using hashes here.

File details

Details for the file sawari-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: sawari-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 63.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.9 Darwin/21.6.0

File hashes

Hashes for sawari-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 712da43198e12736caeae4f785312eafe6beb93b8e91a0bbd817a5654de25d88
MD5 0da8bb305097ce7c54fc63c23bca7f16
BLAKE2b-256 be2b316de1aebbc25859f17468e65ac3728eaa218b8524b49f66d0d57b1a0291

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page