AGENT SKILL

download-d3-v6

Use when you need to obtain the D3.js v6 minified library file and save it locally for a web app.

License 许可
MIT
最近更新
2026-10-02
Stars
★ 93
Forks
8

01 前言 Front Matter

name
download-d3-v6
description
Use when you need to obtain the D3.js v6 minified library file and save it locally for a web app.

03 SKILL.md 正文

Downloading D3.js v6 Minified

import urllib.request
import os

os.makedirs('/root/output/js/', exist_ok=True)

url = 'https://cdnjs.cloudflare.com/ajax/libs/d3/6.7.0/d3.min.js'
dest = '/root/output/js/d3.v6.min.js'

try:
    urllib.request.urlretrieve(url, dest)
    print(f"Downloaded D3 v6 to {dest}")
except Exception as e:
    print(f"Download failed: {e}")
    # Fallback: write a minimal stub or try alternate CDN
    alt_url = 'https://d3js.org/d3.v6.min.js'
    urllib.request.urlretrieve(alt_url, dest)

Verify the file is non-empty after download:

size = os.path.getsize(dest)
print(f"File size: {size} bytes")
assert size > 100000, "D3 file seems too small — download may have failed"

04 同仓库更多 Skills