@epilot/switching-deadlines

中文文档
2027.1.0发布于 2026/07/31MITTypeScriptESM + CJS近 30 天下载 2711

Energy supplier contract switching deadlings for the German energy market after GPKE/GeLi Gas

原始使用文档
文档目录3 节
  1. ✨ Features
  2. 🚀 Quick Start
  3. 📜 Disclaimer

epilot Contract Switching Deadlines Utilities

A TypeScript library for handling German energy market compliance requirements, specifically supplier switching deadlines as defined by GPKE (power) and GeLi Gas (gas).

This library is regularly updated to reflect the latest calendar updates. You can find the changelog at here.

✨ Features

📅 Automatic calculation of switching deadlines

Handles supplier switching deadlines for power and gas according to GPKE and GeLi Gas.

🔄 Use-case and commodity-aware

Separate rules for power (Strom) and gas (Gas), covering multiple switching scenarios:

  • Supplier switch (Lieferantenwechsel)
  • Relocation (Umzug)
  • New connection / initial supply (Neuanlage / Erstbelieferung)

🕑 Public and special holidays included

Accounts for one-time public holidays and special holidays (Sonderfeiertage), e.g.:

  • 8 May 2025 (Tag der Befreiung, Berlin public holiday)
  • 6 June 2025 (Einmaliger Sonderfeiertag zur Einführung des LFW24)

🚀 Quick Start

Install via npm, yarn, or pnpm:

npm install @epilot/switching-deadlines

The library provides helper functions for simple calculations. With calculateDeadline, you can calculate the deadline for a given commodity, use case, and date:

import { calculateDeadline, Commodity, UseCase } from '@epilot/switching-deadlines';

const result = calculateDeadline({
  commodity: Commodity.POWER,
  useCase: UseCase.SWITCH,
  requiresTermination: true,
  fromDate: '2025-10-01'
});

console.log(result); // '2025-10-07'

For multiple calculations, use the DeadlineCalculator class directly:

import { DeadlineCalculator, Commodity, UseCase } from '@epilot/switching-deadlines';

const calculator = new DeadlineCalculator()
const today = new Date()

const relocationResult = calculator.calculateEarliestStartDate(
  {
    commodity: Commodity.POWER,
    useCase: UseCase.RELOCATION,
    requiresTermination: false
  },
  today
)

const switchResult = calculator.calculateEarliestStartDate(
  {
    commodity: Commodity.POWER,
    useCase: UseCase.SWITCH,
    requiresTermination: true
  },
  today
)

console.log(
  `${`The earliest start date is ${relocationResult.earliestStartDate} for relocation and ${switchResult.earliestStartDate} for switching`}`
)

You can find more information in the 📖 usage examples.

Comprehensive documentation and background information are available in the 👉 epilot dev center.

📜 Disclaimer

This library is provided as an open-source contribution to the community to support flexibility when building custom systems around the epilot Energy XRM. It is not intended as a standalone product. Support is only provided for epilot customers.

If you are an active epilot customer, you can alternatively use our Switching Deadlines REST API, which offers the same logic as a web service.

For questions or feedback regarding this library, please reach out to the epilot team.


Built with ❤️ love & dedication 🔥 by team Tauro at epilot.

版本与发布记录

@epilot/switching-deadlines 共发布 6 个版本,首次发布于 2025/09/18;过去 12 个月发布了 1 个版本。

版本发布日期距今
2027.1.0latest2026/07/313 个月前
2025.1.22025/11/061 年前
2025.1.12025/11/061 年前
2025.1.02025/09/301.1 年前
2025.1.42025/09/301.1 年前
0.1.0-alpha2025/09/181.2 年前

关于 @epilot/switching-deadlines 的常见问题

@epilot/switching-deadlines 是什么?

Energy supplier contract switching deadlings for the German energy market after GPKE/GeLi Gas

如何安装 @epilot/switching-deadlines?

在项目目录运行 npm install @epilot/switching-deadlines,或使用 pnpm add / yarn add / bun add。

@epilot/switching-deadlines 支持 TypeScript 吗?

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

@epilot/switching-deadlines 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@epilot/switching-deadlines 可以商用吗?

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

@epilot/switching-deadlines 的下载量有多少?

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

@epilot/switching-deadlines 还在维护吗?

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