charting-library-downloader
v1.0.0
Published
Download the TradingView charting library and all required bundle assets for local use
Downloads
27
Maintainers
Readme
charting-library-downloader
CLI tool that downloads the TradingView Charting Library from TradingView's public CDN and saves a complete, self-contained copy to your project.
It starts from the library entry files, walks webpack runtime bundles to discover chunk dependencies, and downloads referenced CSS, fonts, WASM, and locale bundles. The result is ready to serve from your app (for example under public/charting_library/).
Requires Bun — this package is intended to be run with bunx.
What it downloads
From https://trading-terminal.tradingview-widget.com/charting_library/:
- Root assets:
charting_library.js, ESM/CJS builds, TypeScript definitions,sameorigin.html, andpackage.json - Webpack
bundles/chunks discovered by parsing the runtime and dependency graph - CSS bundles (including RTL variants when present)
- Locale bundles for all supported languages, or a single locale when
--localeis set - Assets referenced in downloaded files (
url(...), fonts, SVG, WASM, etc.)
After a successful run, the output directory contains the library files plus charting-library-download-manifest.json with download stats, file list, and any optional or failed paths.
Install & run
No install step is required. Run directly with Bun:
bunx charting-library-downloader --out ./public/charting_libraryDownload only one locale (smaller output, faster):
bunx charting-library-downloader --out ./public/charting_library --locale enShow help:
bunx charting-library-downloader --helpOptions
| Option | Description |
|--------|-------------|
| --out <dir> | Output directory (required). Created if it does not exist. |
| --locale <code> | Download bundles for one locale only (e.g. en, de, zh_TW). Without this flag, all supported locales are fetched; missing optional locale files are skipped. |
| --help, -h | Print usage and exit. |
Local development
Clone the repo and run the entry file with Bun:
bun install
bun run index.ts --out ./out/charting_libraryExit codes
0— all required files downloaded1— one or more required downloads failed (see manifest / stderr summary)
Optional locale files that are not available on the CDN are recorded in the manifest and do not fail the run.
Publishing
From the package root, after logging in to npm:
bun pm pack # optional: inspect the tarball
bun publish --access publicLicense
MIT
