Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/watergis/sprite-creator
- Owner: watergis
- License: mit
- Created: 2020-07-22T11:39:55.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-06-22T14:35:02.000Z (over 1 year ago)
- Last Synced: 2024-10-30T05:43:06.751Z (21 days ago)
- Topics: mapbox, sprite, vectortiles
- Language: JavaScript
- Size: 18.6 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
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
```