# offline-iconfont

> An util to help you download fonts and assets from [iconfont.cn](http://iconfont.cn/)

Latest version **1.2.0** (published 2022-11-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install offline-iconfont
pnpm add offline-iconfont
yarn add offline-iconfont
bun add offline-iconfont
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2022-11-09 |
| First published | 2020-03-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 79.2 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | vagusX |
| Maintainers | vagusx |

## Links

- npm: https://www.npmjs.com/package/offline-iconfont
- Repository: https://github.com/vagusX/offline-iconfont
- Homepage: https://github.com/vagusX/offline-iconfont#readme
- Issues: https://github.com/vagusX/offline-iconfont/issues
- npm.io page: https://npm.io/package/offline-iconfont

## Dependencies (3)

- [got](https://npm.io/package/got.md) ^10.6.0
- [ora](https://npm.io/package/ora.md) ^4.0.3
- [rename](https://npm.io/package/rename.md) ^1.0.4

## Recent versions

- 1.2.0 (latest) — 2022-11-09
- 1.1.0 — 2020-03-03
- 1.0.1 — 2020-03-03
- 1.0.0 — 2020-03-03

## README

# offline-iconfont

An util to help you download fonts and assets from [iconfont.cn](http://iconfont.cn/)

[![NPM version](https://img.shields.io/npm/v/@vagusx/offline-iconfont.svg?style=flat)](https://www.npmjs.com/package/offline-iconfont)
[![NPM downloads](http://img.shields.io/npm/dm/@vagusx/offline-iconfont.svg?style=flat)](https://www.npmjs.com/package/offline-iconfont)
[![Github Action](https://github.com/vagusx/offline-iconfont/actions/workflows/test.yml/badge.svg)](https://github.com/vagusX/offline-iconfont/actions/workflows/test.yml)

## Installation

```bash
$ npm install offline-iconfont

# or use yarn
$ yarn add offline-iconfont
```

## Usage

```js
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

```ts
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](http://iconfont.cn/) project url

![iconfont.cn](./assets/sample.png)

[![JavaScript Style Guide](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)

---
_Source: https://npm.io/package/offline-iconfont · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
