handlebars-helper-svg

2.0.2 • Public • Published

handlebars-helper-svg

A helper to inline svg efficiently

Use

Register this module as a handlebars helper, and then you can load SVG files from packages.

In your template:

<div class='thing'>
    {{svg "somepackage/test.svg" width="109"}}
</div>
<div class='someotherplace'>
    {{svg "somepackage/test.svg" width="22"}}
</div>

The SVG will be inlined, and attributes will be added to the root element.

This module only works for server-side rendering, though contributions to add browser support are welcome.

Dependencies (2)

Dev Dependencies (2)

Package Sidebar

Install

npm i handlebars-helper-svg

Weekly Downloads

4

Version

2.0.2

License

ISC

Unpacked Size

3.11 kB

Total Files

6

Last publish

Collaborators

  • aredridel