@evicons/svg

中文文档
0.8.0发布于 2026/11/04MITCommonJS零依赖构建来源已验证近 30 天下载 2225

EVicons raw SVG icons, sprite and metadata for e-mobility and EV charging

原始使用文档

EVicons

@evicons/svg

Website: evicons.dev

Raw SVG files, an SVG sprite and metadata for EVicons, an MIT-licensed icon library for e-mobility and EV charging.

All files are generated from the sources in icons/ of the repository. Do not edit them by hand.

Usage

<img src="node_modules/@evicons/svg/svg/<name>.svg" alt="" />

Icons use currentColor and contain no fixed colours. Inline the SVG (or use the sprite) to colour it with CSS.

Sprite:

<svg width="24" height="24"><use href="sprite.svg#evicon-<name>" /></svg>

Map markers (marker-*.svg) can be drawn filled because their first <path> is the pin. Page CSS cannot reach into the sprite, so for filled markers inline the SVG or fill the SVG string before you use it as an image; see Map markers in the repository README.

Metadata (names, categories, meanings, tags, aliases) is in icons.json:

import icons from '@evicons/svg/icons.json' with { type: 'json' }

OpenStreetMap tags (amenity=charging_station, socket:<type>=<count>, ...) map to icons in osm.json, an object from tag to icon name; the same tags are in the osm field of icons.json. A bare key such as socket:type2 stands for any value, key=value for that value only. See OpenStreetMap in the repository README for the full table and examples:

import osm from '@evicons/svg/osm.json' with { type: 'json' }

osm['socket:type2_combo'] // 'plug-ccs2'

OCPI values (OCPI 2.2.1 and 2.3.0, Locations module) map to icons in ocpi.json, an object from <Object>.<field>=<VALUE> to icon name; the same values are in the ocpi field of icons.json. See OCPI in the repository README for the full table and an example:

import ocpi from '@evicons/svg/ocpi.json' with { type: 'json' }

ocpi['Connector.standard=IEC_62196_T2_COMBO'] // 'plug-ccs2'
ocpi['EVSE.status=CHARGING'] // 'status-occupied'

License

MIT

版本与发布记录

@evicons/svg 共发布 10 个版本,首次发布于 2026/11/02;过去 12 个月发布了 10 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.8.0latest2026/11/049 天前
0.7.02026/11/049 天前
0.6.02026/11/0410 天前
0.5.12026/11/0410 天前
0.5.02026/11/0410 天前
0.4.02026/11/0410 天前

关于 @evicons/svg 的常见问题

@evicons/svg 是什么?

EVicons raw SVG icons, sprite and metadata for e-mobility and EV charging

如何安装 @evicons/svg?

在项目目录运行 npm install @evicons/svg,或使用 pnpm add / yarn add / bun add。

@evicons/svg 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/evicons__svg 是否存在。

@evicons/svg 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@evicons/svg 可以商用吗?

@evicons/svg 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@evicons/svg 的下载量有多少?

根据 npm 官方下载统计,@evicons/svg 在 2026/10/14 – 2026/11/12 这 30 天内被下载 2,225 次,日均约 74 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@evicons/svg 还在维护吗?

最新版本 0.8.0 发布于 2026/11/04(9 天前);至今共发布 10 个版本,其中过去 12 个月发布了 10 个;首次发布于 2026/11/02。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。