1.2.0 • Published 2 years ago

offline-iconfont v1.2.0

Weekly downloads
1
License
MIT
Repository
github
Last release
2 years ago

offline-iconfont

An util to help you download fonts and assets from iconfont.cn

NPM version NPM downloads Github Action

Installation

$ npm install offline-iconfont

# or use yarn
$ yarn add offline-iconfont

Usage

const download = require('offline-iconfont')

(async () => {
  await download({
    cssUrl: '//at.alicdn.com/t/font_1231231.css', // your iconfont.cn project url
    dir,
    extnameList: ['svg', 'eot'],
    cssOffline: false
  })
})()

Options

function OfflineIconfont(config: OfflineIconfontConfig): void;

interface OfflineIconfontConfig {
  /**
   * css url from your iconfont.cn project
   */
  cssUrl: string;
  /**
   * where to locate font assets
   * @default process.cwd()
   */
  dir?: string;
  /**
   * file name for font asset
   * @default 'iconfont'
   */
  filename?: string;
  /**
   * replace font asset path to local relative path
   * @default true
   */
  cssOffline?: boolean;
  /**
   * specify which file to download
   */
  extnameList?: string[];
}

Find your iconfont.cn project url

iconfont.cn

JavaScript Style Guide

1.2.0

2 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago