🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

iconfont-url

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iconfont-url

获取iconfont中项目图标的在线链接

0.0.4
latest
Source
npm
Version published
Maintainers
1
Created
Source

Why

项目中使用 CDN 的方式引入字体图标,正常情况下我们每次更新图标之后就要重新手动复制 iconfont 的在线链接,通过该项目,我们可以使用代码直接获取 iconfont 的在线链接,然后通过 webpack 的插件自动生成对应的 script 标签

Install

npm i iconfont-url
# or
yarn add iconfont-url

Usage

import { getOnlineUrl } from 'iconfont-url'

// projectName: required, iconfont的项目名称,自己拥有的项目或者自己参与的项目
//     cookie : required , https://www.iconfont.cn 站点 的 cookie
getOnlineUrl('your project name ', 'your cookie')

with Webpack

你可以使用iconfont-url-plugin,该 webpack 插件可以获取 iconfont 在线链接并将对应的 html 标签自动注入到生成的 html 中

登录 iconfont , 打开网络面板,随便找一个请求,复制 cookie leftover

TODO

    • add unit test

LICENSE

MIT

Keywords

get-iconfont-url

FAQs

Package last updated on 16 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts