npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

fontparsing

v1.0.3

Published

解析字体文件生成对应的字体编码

Readme

fontparsing

fontparsing是一个根据字体文件解析生成对应字体图标文档,可以用fontparsing来生成对应字体文件的字体图标CSS,使用简单。

INSTALL

npm install fontparsing --sava

使用

const fontPaser = require('fontparsing');
const path = require('path');

// 配置编译
fontPaser({
  // 入口字体文件
  entry:path.resolve(__dirname, 'font/iconfont.ttf'),
  // 编译出来的css及html路径
  output:{
    path:path.resolve(__dirname, 'dist'),
    filename: 'test',
    className:'test-icon'
  }
});

配置好选项,node执行,生成对应的文件

├── dist
│   ├── test.css
│   └── test.html
├── font
│   ├── iconfont.eot
│   ├── iconfont.ttf
│   ├── iconfont.woff
│   └── iconfont.woff2
└── index.js

配置代码写在Index.js

Test

先确保安装依赖包 npm install 再运行npm test 之后访问 ./test/dist/test.html


API

fontPaser({
  // 入口字体文件
  entry:path.resolve(__dirname, 'font/iconfont.ttf'),
  // 编译出来的css及html路径
  output:{
    // 生成文件目录地址
    path:path.resolve(__dirname, 'dist'),
    // 生成的文件名
    filename: 'test',
    // 生成CSS的字体图片class名称
    className:'test-icon'
  }
});

Keywords

字体文件解析、字体文件生成CSS

交流分享

QQ群:323750798