@ghs-hazard-pictograms/assets

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

Static image assets for all GHS hazard and ADR/UN transport pictograms — SVG, PNG, JPG, and WebP at five sizes (240–2048 px)

原始使用文档
文档目录10 节
  1. Installation
  2. File formats and sizes
  3. Directory structure
  4. Usage
  5. In a bundler (webpack, Vite, etc.)
  6. In HTML
  7. With a CDN
  8. Looking up asset paths via @ghs-hazard-pictograms/core
  9. Related packages
  10. Links

@ghs-hazard-pictograms/assets

Static image assets for all GHS chemical hazard pictograms (GHS01–GHS09) and UN transport hazard class pictograms. Every pictogram is provided as an optimised SVG plus raster exports at five sizes in PNG, JPEG, and WebP.

This package is a collection of static files with no JavaScript runtime. It is consumed by @ghs-hazard-pictograms/css and can be used directly in any project that needs the raw image files.

Installation

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

File formats and sizes

FormatSizes (px²)
SVG— (vector, resolution-independent)
PNG240, 512, 768, 1024, 2048
JPEG240, 512, 768, 1024, 2048
WebP240, 512, 768, 1024, 2048

Directory structure

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
    ...

Usage

In a bundler (webpack, Vite, etc.)

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;

In 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"
/>

With a CDN

If your bundler copies node_modules assets to a public directory, reference them via the resolved path. For example with Vite's public/ copy or a CDN that hosts your node_modules:

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

Looking up asset paths via @ghs-hazard-pictograms/core

If you need to resolve asset paths programmatically:

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
PackageDescription
@ghs-hazard-pictograms/coreRaw data, inline SVGs, and lookup helpers (framework-agnostic)
@ghs-hazard-pictograms/reactReady-to-use React components (inline SVG, no external files needed)
@ghs-hazard-pictograms/cssCSS sprite sheet that references these asset files
@ghs-hazard-pictograms/spriteSVG <symbol> sprite for <use href> embedding

版本与发布记录

@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 是什么?

Static image assets for all GHS hazard and ADR/UN transport pictograms — SVG, PNG, JPG, and WebP at five sizes (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 和提交记录判断。