# @ghs-hazard-pictograms/assets 中文文档

规范地址：https://npmcn.com/package/%40ghs-hazard-pictograms/assets/

版本：2\.1\.0
npm 元数据更新时间：2026-11-15T22:16:47.105Z
中文译文更新时间：2026-11-16T08:05:34.566Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40ghs-hazard-pictograms/assets
原文对照：https://npmcn.com/package/%40ghs-hazard-pictograms/assets/?lang=original
项目主页：https://karlnorling.github.io/ghs-hazard-pictograms/
源码仓库：https://github.com/karlnorling/ghs-hazard-pictograms

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：23.8 MB，759 个文件
- 模块格式：CommonJS
- TypeScript 类型：未声明
- 运行依赖：0 个
- 首次发布：2026-04-14T12:31:26.546Z
- 最新版本发布：2026-11-15T22:16:46.778Z
- 近 30 天下载量：8427（2026-10-17 至 2026-11-15，npm 官方下载统计）
- 已发布版本数：8（近 12 个月 8 个）

## 中文简介

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

## 安装

```sh
npm install @ghs-hazard-pictograms/assets
```

也可以使用：`pnpm add @ghs-hazard-pictograms/assets`、`yarn add @ghs-hazard-pictograms/assets`、`bun add @ghs-hazard-pictograms/assets`

## README

# @ghs- 危险图/资产

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

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

## 安装

```sh
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 |
| 网络P | 240、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等)中

```ts
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 中

```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`数字 :

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

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

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

```ts
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`](https://www.npmjs.com/package/@ghs-hazard-pictograms/core) | 原始数据、内置的 SVGs 和搜索助手(框架-不可知) |
| [`@ghs-hazard-pictograms/react`](https://www.npmjs.com/package/@ghs-hazard-pictograms/react) | React 组件( 内置 SVG, 不需要外部文件) |
| [`@ghs-hazard-pictograms/css`](https://www.npmjs.com/package/@ghs-hazard-pictograms/css) | 引用这些资产文件的 CSS 图示工作表 |
| [`@ghs-hazard-pictograms/sprite`](https://www.npmjs.com/package/@ghs-hazard-pictograms/sprite) | 特别工作组 `<symbol>` 图标用于 `<use href>` 嵌入 |

## 链接

-   **文档 :** [(原始内容存档于2013-10-12). karlnorling.github.io/ghs-危险-相图](https://karlnorling.github.io/ghs-hazard-pictograms/)
-   **资料来源:** [github.com/karlnorling/ghs-危险相图](https://github.com/karlnorling/ghs-hazard-pictograms)
-   **问题:** [github.com/karlnorling/ghs-危险图/问题](https://github.com/karlnorling/ghs-hazard-pictograms/issues)

## 常见问题

### @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 和提交记录判断。

