Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/watergis/sprite-creator

This module is to generate sprite files from icon images.
https://github.com/watergis/sprite-creator

mapbox sprite vectortiles

Last synced: 14 days ago
JSON representation

This module is to generate sprite files from icon images.

Awesome Lists containing this project

README

        

# sprite-creator
![](https://github.com/watergis/sprite-creator/workflows/Node.js%20Package/badge.svg)
![GitHub](https://img.shields.io/github/license/watergis/sprite-creator)

This module is to generate sprite files from icon images.

## Installation

```
npm install @watergis/sprite-creator
```

## Usage

```js
const SpriteCreator = require('@watergis/sprite-creator');

const config = {
sprites:[
{
output_dir: path.resolve(__dirname,'./sprite'), //Output directory path for sprite files
icons: [
path.resolve(__dirname,'./icons'), //Input directory path for SVG icons
],
}
]
};

const spriteCreator = new SpriteCreator();
spriteCreator.build(config.sprites);
```

## Test
```
npm test
```