@ghs-hazard-pictograms/assets

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

所有全球统一制度危险和ADR/UN运输象形图的静态图像资产——SVG、PNG、JPG和WebP,5个尺寸(240-2048 px)

中文使用文档
文档目录10 节
  1. 安装
  2. 文件格式和大小
  3. 目录结构
  4. 使用量
  5. 在捆绑(webpack,Vite等)中
  6. 在 HTML 中
  7. 带CDN
  8. 通过搜索资产路径 @ghs-hazard-pictograms/core
  9. 相关软件包
  10. 链接

@ghs- 危险图/资产

所有全球统一制度化学品危险象形图(GHS01-GHS09)和联合国运输危险类象形图的静态图像资产。 每个象形图都作为优化的SVG+光栅出口提供,在PNG,JPEG,和WebP中为5个尺寸.

这个包是一组没有JavaScript运行时间的静态文件. 它的消耗 @ghs-hazard-pictograms/css 并可以直接用于任何需要原始图像文件的工程.

安装

npm install @ghs-hazard-pictograms/assets
# or
yarn add @ghs-hazard-pictograms/assets
# or
pnpm add @ghs-hazard-pictograms/assets

文件格式和大小

格式大小 (px2)
特别工作组—— (媒介,分辨率独立)
巴布亚新几内亚240、512、768、1024、2048
JPEG 组合240、512、768、1024、2048
网络P240、512、768、1024、2048

目录结构

assets/
  physical_hazards_pictograms/
    ghs01_explosive/
      GHS-pictogram-explos.svg
      GHS-pictogram-explos-240.png
      GHS-pictogram-explos-512.png
      ...
    ghs02_flammable/
    ghs03_oxidizing/
    ghs04_compressed_gas/
    ghs05_corrosive/
  health_hazards_pictograms/
    ghs06_toxic/
    ghs07_health_hazard/
    ghs08_serious_health_hazard/
  environmental_hazards_pictograms/
    ghs09_hazardous_to_environment/
  transport_pictograms/
    ADR_1.svg          (Divisions 1.1–1.3)
    ADR_1.4.svg
    ADR_1.5.svg
    ADR_1.6.svg
    ADR_2.1.svg
    ADR_2.2.svg
    ADR_2.3.svg
    ADR_3.svg
    ADR_5.1.svg
    ADR_5.2.svg
    ADR_6.1.svg
    ADR_8.svg
    UN_transport_pictogram_-_6.2.svg
    UN_transport_pictogram_-_7.svg
    UN_transport_pictogram_-_8.svg
    UN_transport_pictogram_-_9.svg
    ...

使用量

在捆绑(webpack,Vite等)中

import explosiveSvg from '@ghs-hazard-pictograms/assets/assets/physical_hazards_pictograms/ghs01_explosive/GHS-pictogram-explos.svg';

const img = document.createElement('img');
img.src = explosiveSvg;

在 HTML 中

<img
  src="node_modules/@ghs-hazard-pictograms/assets/assets/physical_hazards_pictograms/ghs01_explosive/GHS-pictogram-explos.svg"
  width="64"
  height="64"
  alt="GHS01 Explosive"
/>

带CDN

如果你的捆绑机复制 node_modules 资产输入公共目录,通过解析路径参考。 比如说Vite的 public/ 复制或CDN 主机为您 node_modules数字 :

<img
  src="/assets/ghs-hazard-pictograms/assets/physical_hazards_pictograms/ghs01_explosive/GHS-pictogram-explos-512.png"
/>

通过搜索资产路径 @ghs-hazard-pictograms/core

如果您需要按方案解决资产路径:

import { getPictogram } from '@ghs-hazard-pictograms/core';

const p = getPictogram('ghs01-explosive')!;
console.log(p.assets.svg); // relative SVG path
console.log(p.assets.png[512]); // relative path to 512px PNG
console.log(p.assets.webp[1024]); // relative path to 1024px WebP
软件包说明
@ghs-hazard-pictograms/core原始数据、内置的 SVGs 和搜索助手(框架-不可知)
@ghs-hazard-pictograms/reactReact 组件( 内置 SVG, 不需要外部文件)
@ghs-hazard-pictograms/css引用这些资产文件的 CSS 图示工作表
@ghs-hazard-pictograms/sprite特别工作组 <symbol> 图标用于 <use href> 嵌入

版本与发布记录

@ghs-hazard-pictograms/assets 共发布 8 个版本,首次发布于 2026/04/14;过去 12 个月发布了 8 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
2.1.0latest2026/11/16今天
2.0.02026/10/161 个月前
1.1.02026/05/156 个月前
1.0.52026/05/086 个月前
1.0.42026/04/147 个月前
1.0.22026/04/147 个月前

关于 @ghs-hazard-pictograms/assets 的常见问题

@ghs-hazard-pictograms/assets 是什么?

所有全球统一制度危险和ADR/UN运输象形图的静态图像资产——SVG、PNG、JPG和WebP,5个尺寸(240-2048 px)

如何安装 @ghs-hazard-pictograms/assets?

在项目目录运行 npm install @ghs-hazard-pictograms/assets,或使用 pnpm add / yarn add / bun add。

@ghs-hazard-pictograms/assets 支持 TypeScript 吗?

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

@ghs-hazard-pictograms/assets 支持 ESM 还是 CommonJS?

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

@ghs-hazard-pictograms/assets 可以商用吗?

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

@ghs-hazard-pictograms/assets 的下载量有多少?

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

@ghs-hazard-pictograms/assets 还在维护吗?

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