1.2.2 • Published 4 years ago

svg2html v1.2.2

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

svg2html

Overview

Find the *.svg generated index.html file in a recursive folder. The root file will generate all svg icons with all.html, and other svg that generate the current directory.

Usage

Install with npm

npm i svg2html
const svg2html = require('svg2html')

// directory
svg2html.run({
    inDir: 'test/icons',
    outDir: 'test/build',
    exclude: 'linecons',
    rmAttr: 'opacity|fill',
});

// svg file
svg2html.run({
    inDir: 'test/icons/brands/bing.svg',
    outDir: 'test/build',
    exclude: 'linecons',
    rmAttr: 'opacity|fill',
});
// multiple svg
svg2html.run({
    inDir: ['test/icons/brands/bing.svg', 'test/icons/brands/github.svg', ...],
    outDir: 'test/build',
    exclude: 'linecons',
    rmAttr: 'opacity|fill',
});

svg2html.run(options)

  • inDir {String|Array} required
  • outDir {String} required
  • exclude {String}

    • default: 'node_modules'
    • example: 'test|node_modules'
  • rmAttr {String}

    • example: 'fill|opacity|stroke'

CLI

svg2html.js -i test/icons -o test/build -r 'opacity|fill' -e 'linecons'

Usage: svg2html [options]

Options:
  -v, --version            output the version number
  -i, --inDir <inDir>      svg input directory or svg paths(examples: ./test/a.svg, ./test/b.svg
  -o, --outDir <outDir>    svg output directory
  -r, --rmAttr [rmAttr]    svg remove attr, for example: "fill" or "stroke|fill|opacity" (default: "")
  -e, --exclude [exclude]  exclude directory, for example: "test" or "test|node_modules" (default: "node_modules")
  -h, --help               output usage information
1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.1.0

5 years ago