Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/plotdb/imagesprite
https://github.com/plotdb/imagesprite
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/plotdb/imagesprite
- Owner: plotdb
- Created: 2019-12-21T08:58:50.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T12:47:46.000Z (about 2 years ago)
- Last Synced: 2023-08-24T18:37:42.672Z (over 1 year ago)
- Language: JavaScript
- Size: 2 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# imagesprite
SVG / PNG sprite generator.
## usage
install imagesprite:
npm install @plotdb/imagesprite
command line usage:
npx imagesprite-png srcdir [outdir] [name] [webbase]
npx imagesprite-svg srcdir [outdir] [name] [webbase]Following is the example in `npm run test-build` from our `package.json`:
npx imagesprite-png test/pngs web/static/assets/img/pack/png png-sprite /assets/img/pack/png
npx imagesprite-svg test/svgs web/static/assets/img/pack/svg svg-sprite /assets/img/pack/svgUse with nodejs:
imagesprite = require("@plotdb/imagesprite");
imagesprite.svg(config).then(ret) -> ...config:
- `srcdir`: image directory
- `outdir`: dir for generating sprite image and css
- `name`: generated file name and css class name
- `base`: relative path for accessing the sprite image via web.example:
imagesprite.svg({
root: 'static/assets/img',
outdir: 'static/assets/sprite'
name: 'svg-sprite',
base: '/assets/sprite'
})## License
MIT.