Socket
Socket
Sign inDemoInstall

hbs-svg

Package Overview
Dependencies
42
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    hbs-svg

Generate Handlebars helpers for optimised inline SVG.


Version published
Weekly downloads
12
decreased by-64.71%
Maintainers
1
Install size
4.99 MB
Created
Weekly downloads
 

Changelog

Source

v1.0.4 / 2015-10-31

  • (bc997e9) Add .editorconfig (fixes #3)

Readme

Source

hbs-svg

Build Status NPM version

Generate Handlebars helpers for optimised inline SVG. The optimised SVG files are also saved for those situations where you don't want an inline SVG (e.g. background image).

Usage: hbs-svg [source dir] {OPTIONS}

Examples:
  hbs-svg src/ --hf build/helpers.js --if build/

Options:
  --hf, --helper-file   Write the handlebars helpers to this file  [required]
  --if, --image-folder  Write the optimised images to this folder  [required]

Installation

$ npm install -g hbs-svg

Examples

To optimise SVG files from src/, outputting Handlebars helpers to build/helpers.js and optimised SVG files to build/:

$ hbs-svg src/ --hf build/helpers.js --if build/

You can use the API directly too:

var hbsSvg = require('hbs-svg');

hbsSvg({
  sourceDir: './src',
  helperFile: './build/helpers.js',
  imageFolder: './build'
}, function(){
  console.log('done');
});

Tests

$ npm test

Credits

The idea for this tool was based on this article by @madrobby.

Keywords

FAQs

Last updated on 30 Oct 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc