Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hbs-svg

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hbs-svg

Generate Handlebars helpers for optimised inline SVG.

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 30 Oct 2015

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc