A Node.js script to build a SVG sprite from a folder of SVG files (typically icons). Spritesh not having a Node.js API, you will need to use a wrapper around a CLI call to build your sprite from a Node.js script (such as Gulp). To be able to chain tasks, Gulp needs tasks to return a promise or a stream.
Full article