webfonts-icon
v1.2.0
Published
webfonts icon generator
Downloads
24
Readme
Explain
Icon font generator, Can use icons to fit into the project.
Install
npm i webfonts-icon -D
Usage
Commander
Using the command line to generate font icons
webfonts-icon -f[--files] -d[--dest] -c[--config] -e[--ext]
Npm scripts
Using package.json:
{
"scripts": {
...,
"fonticon": "webfonts-icon -f ./svg/**/*.svg -d ./fonts -e .scss"
}
}
| param | type | explain | | ------ | ------ | --------------------------------------------------------- | | files | string | Icons catalog name, example: ./svg/*/.svg | | dest | string | Directory name of output | | config | object | default: webfonts.config.js, return "object" | | ext | string | Style file ext'name |
API
The way used in script files, Return Promise class. Specific reference to the following script examples:
const webfontsIcon = reqiure('webfonts-icon')
webfontsIcon(options).then(data => {})
or:
const compile = async options => { await webfontsIcon(options) }
Config reference
config item: Extended:
| param | type | explain | | -------------- | -------------------- | ----------------------------------------------------------- | | files | string/pattern/array | glob type path value, default: ./svg/*/.svg | | dest | string | Directory name of output, default: ./fonts | | startCodepoint | number | default: 0xe600 | | extName | string | Style file ext's name, default: .css | | tips | boolen | Tips output success message. default: false |