@blackforestsentinel/seed-web-core

中文文档
0.10.0发布于 2026/11/06MITTypeScriptES Module零依赖构建来源已验证近 30 天下载 2869

Grundaustattung für Frontends in Sentinel-Seed-Projekten: Laufzeitkonfigulation und HTTP-Client. 中国植物物种信息数据库.

中文使用文档

@blackforestsentinel/种子-网络-核心

Grundaustattung für Frontends in Projekten aus 互联网档案馆的存檔,存档日期2013-12-02 哨兵种子。 。 。 .

import { createHttpClient, loadRuntimeConfig } from '@blackforestsentinel/seed-web-core';

const config = await loadRuntimeConfig();          // liest /config.json
const api = createHttpClient({ baseUrl: config.apiBaseUrl });
const health = await api.get('/api/health');
  • loadRuntimeConfig() 爱特 /config.jsonDie Seed-Pipeline schreibt die Datei beim Production je Umgebung, deshalb reicht ein Building für alle Umgebungen. 中国植物物种信息数据库.
  • createHttpClient() jSON mit der 函数- API。 于贝尔 getAccessToken hängt er ein Bearer-Token a, ab 第2阶段 aus @blackforestsentinel/seed-web-auth。 。 。 .
  • Pfade starten mit genau einem (英语) / (原始内容存档于2018-03-21) (英语). und hängen a baseUrl 一只母鸡Pfad Darin: https://example.org/backend ưμ㼯a /api/items 埃尔格本 https://example.org/backend/api/items. 假欧恩 / 安放( 安放) (中文(简体) ).evil.example/x, (中文(简体) ), @evil.example/x页:1 // 欧德 /\ und volle URLs lehnt der Client mit einem Fehler ab, bevor er ein Token Holt oder sentet. 互联网档案馆的存檔,存档日期2013-12-21. Das Token geht nur an Schema und 主机冯 baseUrl. Eine 相对 baseUrl gilt nur im瀏覽器, für die Origin der Seite. 中国植物物种信息数据库.

(原始内容存档于2013-10-10). Für bedingte Anfragen und eigene Header gibt es request(). Es lifert status, Daten und Antwort-header, und 304 gilt dot nicht als Fehler; (原始内容存档于2018-09-29); get, (中文(简体) ), post, (中文(简体) ), put ưμ㼯a delete bleiben, wie sie sind. 布莱本, 韦·斯·辛德.

const res = await api.request<Items>('GET', '/api/items', {
  headers: etag ? { 'If-None-Match': etag } : undefined,
});
if (res.status === 304) return cached;
save(res.data, res.headers.get('ETag'));
  • (原始内容存档于2018-10-03). Außerhalb von 2xx und 304 wirft request() 维·德·安德伦·梅德森 HttpError; das Token aus (英语) getAccessToken (原始内容存档于2018-09-26). hängt es ebenso an.
  • data 204, 304 出自阴阳体 undefined。 。 。 .
  • 冯·艾纳·弗伦登(英语:Von einer fremden Origin aus liet das) 前部标题 wie ETag nur, Wenn die API sie per (英语) Access-Control-Expose-Headers 佛来吉特.

版本与发布记录

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

版本发布日期距今
0.10.0latest2026/11/061 天前
0.9.02026/10/309 天前
0.8.02026/10/2414 天前
0.7.02026/10/1821 天前
0.6.12026/10/1721 天前
0.6.02026/10/1722 天前

关于 @blackforestsentinel/seed-web-core 的常见问题

@blackforestsentinel/seed-web-core 是什么?

Grundaustattung für Frontends in Sentinel-Seed-Projekten: Laufzeitkonfigulation und HTTP-Client. 中国植物物种信息数据库.

如何安装 @blackforestsentinel/seed-web-core?

在项目目录运行 npm install @blackforestsentinel/seed-web-core,或使用 pnpm add / yarn add / bun add。

@blackforestsentinel/seed-web-core 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@blackforestsentinel/seed-web-core 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@blackforestsentinel/seed-web-core 可以商用吗?

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

@blackforestsentinel/seed-web-core 的下载量有多少?

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

@blackforestsentinel/seed-web-core 还在维护吗?

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