npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@svgfx/cli

v0.5.0

Published

Apply post-processing effects to any SVG from the terminal. Scanlines, bloom, glitch, halftone and more.

Readme

@svgfx/cli

svgfx logo.svg -p crt

Post-processing effects for any SVG, straight from your shell.

Pipe it, point it at a file, a directory or a URL — get back a real SVG with scanlines, bloom, glitch, halftone or a dozen other looks baked in. Still vector, still editable, no rasterizing.

npm license


Highlights

  • ✅ Pipe-first — cat logo.svg | svgfx -p vhs > out.svg just works.
  • ✅ Every input — file, directory, glob, stdin, -, or an https:// URL.
  • ✅ Stackable effects — -e is repeatable and order preserving, exactly like the library's array.
  • ✅ 27 effects + 8 presets — one binary, svgfx list to see them all.
  • ✅ Batch a folder — svgfx icons/ -p riso -o dist/.
  • ✅ Deterministic — --seed makes output byte-identical run to run.
  • ✅ Data URIs — --data-uri for dropping straight into CSS or HTML.
  • ✅ Keeps existing animation — an SVG that already animates keeps animating.

Table of contents


Installation

npm install -g @svgfx/cli

Or run it without installing:

npx @svgfx/cli logo.svg -p crt -o out.svg

Quick start

svgfx logo.svg -e bloom                        # one effect, printed to stdout
svgfx logo.svg -p crt -o out.svg               # a preset, written to a file
cat logo.svg | svgfx -p vhs > out.svg          # piped in, redirected out
svgfx icons/ -p riso -o dist/                  # a whole directory
svgfx list                                     # everything available

Effects stack in the order you pass them, the same way they do in the library:

svgfx logo.svg -e "bloom:radius=8" -e "scanlines:gap=3" -e "grain:amount=0.3"

Input

| Form | Example | | ---- | ------- | | File | svgfx logo.svg -p crt | | Several files | svgfx a.svg b.svg -e invert -o dist/ | | Glob (shell expands it) | svgfx icons/*.svg -p riso -o dist/ | | Directory | svgfx icons/ -p riso -o dist/ | | Piped stdin | cat logo.svg \| svgfx -p vhs | | Explicit stdin | svgfx - -e grain < logo.svg | | Remote URL | svgfx https://example.com/logo.svg -p neon |

Directories are scanned one level deep for .svg files, sorted by name.

Output

| Flag | Behaviour | | ---- | --------- | | (none) | Writes the SVG to stdout, so it pipes and redirects | | -o out.svg | Writes one file | | -o dist/ | Writes into a directory, keeping each input's filename | | -i, --in-place | Overwrites the input files | | -u, --data-uri | Emits a data: URI instead of markup | | -b, --base64 | Base64-encodes the data URI |

Written paths are reported on stderr, so stdout stays clean for piping. Use -q to silence it.

Effects

svgfx list prints all of these with their options.

| | | | --- | --- | | Light | blur bloom glow shadow | | Colour | grayscale saturate hue-rotate invert brightness contrast sepia fade posterize threshold duotone tint | | Texture | grain scanlines chromatic-aberration glitch pixelate halftone vignette outline wave emboss sharpen |

Options go after a colon, comma separated. Keys accept kebab-case or camelCase:

svgfx logo.svg -e "halftone:size=5,angle=15,keep-source=true"
svgfx logo.svg -e "glow:color=#ff2d55,radius=8"
svgfx logo.svg -e "grain:animate"              # a bare key means true

Overlays follow your SVG's shape

scanlines, vignette and halftone lay something over the drawing rather than filtering it. They mask that overlay to the artwork's own silhouette, so a rounded terminal window, a logo on transparency, or anything with a non-rectangular shape keeps its edges instead of getting a rectangle painted over it.

svgfx terminal.svg -p crt -o out.svg              # rounded corners survive
svgfx terminal.svg -e scanlines:clip=viewport   # opt out, fill the whole frame

Presets

| Preset | Look | | ------ | ---- | | crt | Phosphor glow, scanlines, colour fringing, vignette | | vhs | Tape wobble, heavy fringing, rolling lines, noise | | riso | Two-colour risograph with paper grain | | xerox | Blown-out photocopy | | neon | Saturated sign glow | | film | Halation, grain and a soft vignette | | newsprint | Halftone dots on off-white stock | | cyberpunk | Sliced, shifted, bloomed, scanned |

Presets take options too:

svgfx logo.svg -p "riso:shadow=#2b3a67,highlight=#ff5a5f"
svgfx logo.svg -p "crt:animate=true"

Options

| Flag | Default | Description | | ---- | ------- | ----------- | | -e, --effect | | Effect to apply. Repeatable, order preserving | | -p, --preset | | Preset to apply. Repeatable | | -c, --config | | JSON file holding the effect stack | | -o, --output | stdout | Output file, or directory for several inputs | | -i, --in-place | false | Overwrite the input files | | -u, --data-uri | false | Emit a data: URI | | -b, --base64 | false | Base64-encode the data URI | | -s, --seed | svgfx | Seed for every random decision | | --prefix | svgfx | Prefix for generated ids | | --scope | auto | Id namespace, defaults to a hash of the input and effects | | -a, --animate | true | Allow animation. --no-animate for a still frame | | -f, --format | preserve | preserve, pretty or minify | | -q, --quiet | false | Do not report written files |

Recipes

A stack you reuse, kept in a file

[
  { "effect": "duotone", "shadow": "#111d4a", "highlight": "#ffd166" },
  { "effect": "halftone", "size": 5, "angle": 15 },
  "grain:amount=0.3"
]
svgfx logo.svg -c poster.json -o poster.svg

Straight into CSS

echo "background-image: url('$(svgfx logo.svg -p crt -u)');"

Every icon in a folder, minified

svgfx icons/ -p riso -f minify -o dist/

An SVG that already animates keeps animating

svgfx spinner.svg -p crt -o spinner-crt.svg

Reproducible output in CI

svgfx logo.svg -e glitch --seed release-42 -o out.svg

Library

This is the terminal front end for @svgfx/postprocessing. Every effect, option and default is the same — reach for the library when you want this inside a build script or an app.

npm install @svgfx/postprocessing

License

MIT © Tal Hayut