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

laravel-elixir-svg-sprite

v0.1.4

Published

Laravel Elixir wrapper for gulp-svg-sprite

Readme

Laravel Elixir SVG Sprite

Extension to Laravel Elixir that wraps gulp-svg-sprite

Install

npm install laravel-elixir-svg-sprite --save-dev

Use

In your Laravel gulpfile.js

var elixir = require('laravel-elixir');
require('laravel-elixir-svg-sprite');

...

elixir(function(mix) {

    mix.svgSprite();

});

This will use the extension's default options, which are to find .svg files inside an svg directory in your resources folder (either Laravel 5's default or your own defined in elixir.json). It will output the spritesheet files svg-include.svg and svg-include.html (for previewing) to public/svg/symbols which can then be included in your main layout file, right after <body>.

<body>
    @if(file_exists(public_path() . '/svg/svg-include.svg'))
        <?php include(public_path() . '/svg/svg-include.svg'); ?>
    @endif
    ...

for an easier include, see option: bladePartial

You can then use the symbols freely in your app:

<svg class="styling-class">
    <use xlink:href="#symbol-id"></use>
</svg>

Configure

Of course you can override the extension's settings and pass some additional options by passing parameters. It might end up looking something like this in your project gulpfile.js:

mix.svgSprite({
    srcDir: './resources/assets/svg/',
    outputDir: './public/icons/',
    bladePartial: 'svgicons',
    svg: {
        xmlDeclaration: false,
        doctypeDeclaration: false
    },
    shape: {
        id: {
            separator: '-',
            generator: 'icon-%s'
        }
    },
    mode: {
        symbol: {
            prefix: '.icon .%s',
            inline: true,
            sprite: 'svg',
            dest: 'svg'
        }
    }
});

... as an example

srcDir

The path to the directory that holds the original separate SVG files.

outputDir

Path to the directory that will hold the generated spritesheet file.

rename

By default the generated file is called svg-include.svg. Change this to change the name of the files. Don't include any extensions as this will only change the file basenames.

bladePartial, bladePartialDir

By default the generated file svg-include.svg will be copied to a blade partial. This way you can include it in your main blade template like so:

<body>
    @include('partials.svg-include')

You can pass the option of a different file name (string) such as bladePartial: "svgicons" and the extension .blade.php will be added automatically, resulting in svgicons.blade.php. You can pass the option of a partials directory (string) such as bladePartialDir: "./resources/views/some/dir/" or by default will use ./resources/views/partials/. You can deactivate blade partials by passing false (boolean) as such bladePartial: false.


The rest are options that are passed along to gulp-svg-sprite and the parent svg-sprite to override the defaults. Read the README for more info on those.

Credit goes to