Synchronises local SVG icons with the upstream simple-icons repository.
The script is intended for folders such as assets/ananke/socials/ that already contain SVG icon files. By default it runs in dry-run mode, compares local files with upstream files from simple-icons/icons/, and reports what would change.
Run in dry-run mode against existing local files only:
node src/scripts/update-social-icons.ts
Run in dry-run mode and show only non-identical results:
node src/scripts/update-social-icons.ts --only-changed
Apply updates to changed local files:
node src/scripts/update-social-icons.ts --apply
Apply updates and delete local files that are not present upstream:
node src/scripts/update-social-icons.ts --apply --delete
Sync against all upstream icons instead of only the files already present locally:
node src/scripts/update-social-icons.ts --all
Create missing local files from upstream:
node src/scripts/update-social-icons.ts --all --apply
Full sync mode including deletion of extra local files:
node src/scripts/update-social-icons.ts --all --apply --delete
Return JSON output for scripting or automation:
node src/scripts/update-social-icons.ts --all --only-changed --json
Set a custom target folder:
node src/scripts/update-social-icons.ts --dir=assets/ananke/socials
Use a different upstream branch:
node src/scripts/update-social-icons.ts --branch=develop
Reduce or increase concurrency:
node src/scripts/update-social-icons.ts --all --concurrency=4
--dir <path>
Directory containing local SVG icons
assets/ananke/socials--branch <name>
Branch in the simple-icons repository
develop--apply
Actually write changes to disk
--delete
Delete local SVG files that do not exist upstream
would-delete--all
Use the complete upstream icon directory as the source of truth
would-create in dry-run mode--delete--only-changed
Hide same results
--json
Print machine-readable JSON output instead of text output
--verbose
Show local path and remote URL for each printed result
--concurrency <n>
Number of parallel file checks/downloads
8--help
Show usage help
Without --all, the script only checks local .svg files that already exist in the target directory.
For each local file:
simple-icons/icons/<filename>samechangedmissing without --delete
would-delete with --delete in dry-run modedeleted with --delete --applyWith --all, the script first loads the full upstream icon listing from simple-icons/icons/.
For each upstream file:
if the local file does not exist:
would-create in dry-run mode
created in apply modesame
changed in dry-run mode
updated in apply modeFor local files that do not exist upstream:
missing without --deletewould-delete with --delete in dry-run modedeleted with --delete --applysame
local file matches upstream
changed
local file exists, upstream exists, content differs
missing
local file exists, upstream file does not exist, and deletion is not enabled
would-create
upstream file exists, local file does not exist, dry-run mode
created
upstream file exists, local file did not exist, file was created
would-delete
local file exists, upstream file does not exist, dry-run mode with --delete
deleted
local file existed, upstream file does not exist, file was deleted
updated
local file existed, upstream file exists, file was overwritten
error
processing failed for that file
During text-mode execution, the script shows a one-line progress indicator:
Processing 42/180 (active: 5)
This line updates while work is in progress. Individual file results are printed as they complete.
Because processing is concurrent, results may appear in completion order rather than alphabetical order.
When --json is used, the script prints a single JSON object containing:
optionsresultssummaryThis is useful for automation or piping into other tools.
Example:
{
"options": {
"dir": "/path/to/assets/ananke/socials",
"branch": "develop",
"apply": false,
"deleteMissing": false,
"onlyChanged": true,
"json": true,
"verbose": false,
"all": true,
"concurrency": 8
},
"results": [
{
"fileName": "github.svg",
"localPath": "/path/to/assets/ananke/socials/github.svg",
"remoteUrl": "https://raw.githubusercontent.com/simple-icons/simple-icons/develop/icons/github.svg",
"status": "changed",
"message": "Upstream file differs from local file"
}
],
"summary": {
"same": 0,
"changed": 1,
"missing": 0,
"wouldCreate": 0,
"created": 0,
"wouldDelete": 0,
"deleted": 0,
"updated": 0,
"errors": 0
}
}
Use dry-run first:
node src/scripts/update-social-icons.ts --only-changed
node src/scripts/update-social-icons.ts --all --only-changed
node src/scripts/update-social-icons.ts --all --apply
node src/scripts/update-social-icons.ts --all --apply --delete
.svg files.--all mode, extra custom local icons may be deleted if --delete is also used.simple-icons/icons/, then raw file URLs for SVG downloads.4 to 8 is usually a good default.assets/ananke/socials/ with the correct filename (e.g. myicon.svg)changed--apply to update the new icon from upstream