@bbc/moment-timezone-include

中文文档
1.1.8发布于 2021/03/10Apache-2.0CommonJS近 30 天下载 3920

Webpack plugin and timezone data includes to pull in specific timezone data into desired chunks.

原始使用文档
文档目录6 节
  1. Installation
  2. Usage - Exclude default timezones
  3. Usage - Include specific timezones
  4. Contributing
  5. Code of Conduct
  6. License

@bbc/moment-timezone-include - Known Vulnerabilities Dependency Status peerDependencies Status GitHub license npm version PRs Welcome

This package allows you to exclude all moment timezones from being included, while including specific ones in the chunks you desire.

Installation

npm install @bbc/moment-timezone-include --save

Usage - Exclude default timezones

plugins: [new MomentTimezoneInclude({ startYear: 1990, endYear: 2025 })],

This does two things. Firstly it removes all timezones from the moment-timezone package so that they can be included individually. It also specifies the date range of the specifically included timezone data. If startYear isn't provided it defaults to the earliest available data and likewise if endYear isn't included it includes all known future data.

Usage - Include specific timezones

import '@bbc/moment-timezone-include/tz/America/New_York'

This makes the specified timezone available to moment. It supports all moment timezones by replacing America/New_York in the example above with any moment timezone. The full list of timezones can be found here.

Contributing

Psammead is completely open source. We are grateful for any contributions, whether they be new components, bug fixes or general improvements. Please see our primary contributing guide which can be found at the root of the Psammead respository.

Code of Conduct

We welcome feedback and help on this work. By participating in this project, you agree to abide by the code of conduct. Please take a moment to read it.

License

Psammead is Apache 2.0 licensed.

版本与发布记录

@bbc/moment-timezone-include 共发布 10 个版本,首次发布于 2019/08/01;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.1.8latest2021/03/105 年前
1.1.72021/03/025 年前
1.1.62021/02/225 年前
1.1.52021/02/045 年前
1.1.42020/03/306 年前
1.1.32020/03/186 年前

关于 @bbc/moment-timezone-include 的常见问题

@bbc/moment-timezone-include 是什么?

Webpack plugin and timezone data includes to pull in specific timezone data into desired chunks.

如何安装 @bbc/moment-timezone-include?

在项目目录运行 npm install @bbc/moment-timezone-include,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:webpack(^4.38.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@bbc/moment-timezone-include 支持 TypeScript 吗?

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

@bbc/moment-timezone-include 支持 ESM 还是 CommonJS?

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

@bbc/moment-timezone-include 可以商用吗?

@bbc/moment-timezone-include 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@bbc/moment-timezone-include 的下载量有多少?

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

@bbc/moment-timezone-include 还在维护吗?

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