Skip to content
This repository has been archived by the owner on Jan 8, 2023. It is now read-only.

Examples

Lachlan McDonald edited this page May 21, 2018 · 6 revisions

Write SCSS to a file

const fs = require('fs');
const { Saxicon } = require('saxicon');

// Initialise a new Saxicon instance
const sax = new Saxicon();

// Parse SVG files
const result = sax.parseSync([
    'path/to/icon1.svg',
    'path/to/icon2.svg',
    'path/to/icon3.svg',
]);

// Write SCSS to file
fs.writeFile('saxicon.scss', result.scss(), (err) => {
    if (err) {
        throw new Error(err);
    }
});