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

svg-assets

v0.2.1

Published

Replace any <svga>file</svga> tags with related svg files

Readme

#svg-assets Build Status Coverage Status

Warning : This project is still a work in progress. Feel free to report any issues encountered or any possible enhancements.

Future of project : The main goal is to offer Brunch, Grunt, and Gulp plugins.

Why would you need it ?


Using svg in a project is great for many reasons (scalable size, all elements are editable with css, etc.). But a svg file can be sometimes huge, and including its source directly in your template file makes it unreadable.

That's where svg-assets comes to the rescue ! It'll parse any template file to find <svga> tags and replace them with related assets files.

Installation


Installing globally will give you access to the svg-assets command anywhere on your system

npm install -g svg-assets

Usage


svg-assets comes with a few options. These options will be used by default (except directory and assets), and any of them will be replaced by defined ones.

|Option | Default value | Notes| :------------- | :------------------------- | :-----------| | directory | none | default value will be the root of project if preserve-root is set to false | | templates-ext | ['html', 'htm', 'hbs', 'handlebars'] | none | | output-directory | null | if no output directory is set, It will override source template files | | assets | none | default value will be the root of project if preserve-root is set to false | | assets-ext | ['svg'] | none | | preserve-root | true | none | | logLevels | ['warning', 'error', 'info'] | none |


directory

Command: -d, --directory Option format: string (Array support in a further release)

Defines where svg-assets will look for files containing <svga> tags. If not defined, the root directory of your project will be used, except if preserve-root option has been set to true (default behavior).


templates-ext

Command: -t, --templates-ext Option format: string or Array

Defines what kind of template files svg-assets will look for. If not defined, the following extensions will be used : html, htm, hbs, handlebars


output-directory

Command: -o, --output-directory Option format: string

Defines where the processed template files will be saved. :warning: If not defined, source templates files will be overwritten


assets

Command: -a, --assets Option format: string (Array support in a further release)

Defines where svg-assets will look for files matching the value contained by a <svga> tag. If not defined, the root directory of your project will be used, except if preserve-root option has been set to true (default behavior).


assets-ext

Command: -A, --assets-ext Option format: string or Array

Defines what kind of assets files svg-assets will look for. If not defined, the following extension will be used : svg


log-levels

Command: -l, --log-levels Option format: string or Array

Defines what kind of logs will be displayed on console output. If not defined, the following log levels will be used : warning, error, info


preserve-root

Command: -p, --preserve-root Option format: boolean

When set to true, preserve the root directory of your project to be used for finding matching files. This option is set to true by default.

Example


The following command will process template files in foo/ folder, and look for assets in bar/ folder. Processed templates will be saved to foobar/ folder

svg-assets -d foo -a bar -o foobar

If you forked the project, you can also use the following commands to run an example:

npm install
grunt example

License


svg-assets is released under the MIT license