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 🙏

© 2024 – Pkg Stats / Ryan Hefner

rsvg-brunch

v1.0.0

Published

A Brunch plugin for librsvg

Downloads

18

Readme

rsvg-brunch

Copyright 2017-2018, Caleb Evans
Released under the MIT License

Build Status Coverage Status

This plugin enables you to generate PNG icons of various sizes from one or more SVG files.

Usage

1. Install system-wide librsvg

macOS

brew install librsvg

Ubuntu

sudo apt-get install librsvg2-dev

RedHat / OpenSUSE

sudo yum install librsvg2-devel

Windows

See this blog post for librsvg Windows binaries.

2. Set plugin options

In brunch-config.js, you can provide options which should be passed to the plugin.

module.exports = {
  // ...
  plugins: {
    rsvg: {
      // A single "conversion" takes a single SVG file and generates one or more
      // output files (PNG by default)
      conversions: [{
        // The path to the input SVG file
        input: 'app/icons/app-icon.svg',
        // Default values for the below output files (as shown below, these
        // defaults can be overridden)
        outputDefaults: {path: 'icons/app-icon-{w}x{h}.png'},
        // A list of output files to generate
        output: [
          // If the height is not specified, it is assumed to be equal to the
          // width (or vice-versa)
          {width: 32, path: 'favicon.png'},
          {width: 180, path: 'apple-touch-icon.png'},
          // The path for the below icons will inherit from outputDefaults
          {width: 192},
          {width: 256},
          {width: 384},
          {width: 512}
        ]
      }]
    }
  }
  // ...
};

The above configuration will generate the following icons in the user's defined public directory for the project (usually public/):

  • favicon.png (size: 32 x 32)
  • apple-touch-icon.png (size: 180 x 180)
  • icons/app-icon-192x192.png (size: 192 x 192)
  • icons/app-icon-256x256.png (size: 256 x 256)
  • icons/app-icon-384x384.png (size: 384 x 384)
  • icons/app-icon-512x512.png (size: 512 x 512)

Path variables

You will have noticed above that any of the output paths can contain references to that output file's width and height, enclosed in curly brackets. Available variables are:

  • {width}
  • {height}
  • {format}
  • {id}

Configure Travis CI (if necessary)

Because rsvg-brunch requires librsvg to be installed, you'll need to add the following to your .travis.yml if you use Travis CI:

addons:
  apt:
    sources:
    - ubuntu-toolchain-r-test
    packages:
    - g++-4.8
    - librsvg2-dev
env:
  - CXX=g++-4.8