@apostrophecms/scheduled-publishing

中文文档
1.0.6发布于 2026/10/01MITCommonJS零依赖近 30 天下载 3114

Scheduled publishing for ApostropheCMS 3.

原始使用文档
文档目录3 节
  1. Installation
  2. Usage
  3. Using the command line task
ApostropheCMS logo

Scheduled Publishing

GitHub Workflow Status (branch)

This module allows you to schedule publishing of your pieces (which includes pages) to specific dates.

Installation

To install the module, use the command line to run this command in an Apostrophe project's root directory:

npm install @apostrophecms/scheduled-publishing

Usage

Configure the Scheduled Publishing module in the app.js file:

require('apostrophe')({
  shortName: 'my-project',
  modules: {
    '@apostrophecms/scheduled-publishing': {}
  }
});

Editors can now schedule publication and un-publication times for documents. Note that un-publishing a document means it is no longer available except in draft form. Since the home page must always be available, the home page cannot be scheduled for un-publishing.

For publication and un-publication to actually occur, you'll need to run the appropriate command line task on a periodic basis, as described below.

Using the command line task

To actually publish or unpublish the documents at scheduled times, you must execute the appropriate command line task:

node app @apostrophecms/scheduled-publishing:update

Typically you will want to schedule this to run periodically using a standard Linux scheduling tool like cron. For instance, here is a crontab entry to run the task once per hour:

# At the top of every hour
0 * * * * (cd /path/to/your/apostrophe/project && node app @apostrophecms/scheduled-publishing:update)

You can schedule the task to run more frequently if you plan to schedule publication times in the middle of the hour. Note that the task is safe to run as frequently as you wish, as it won't do anything if no documents are scheduled to be published yet.

For more information, see how to use cron on Linux.

If you are using our stagecoach utility for deployment, don't forget /current at the end of the path.

版本与发布记录

@apostrophecms/scheduled-publishing 共发布 6 个版本,首次发布于 2022/05/30;过去 12 个月发布了 1 个版本。

版本发布日期距今
1.0.6latest2026/10/011 个月前
1.0.52024/09/062 年前
1.0.42024/03/212 年前
1.0.32022/09/154 年前
1.0.22022/05/304 年前
1.0.12022/05/304 年前

关于 @apostrophecms/scheduled-publishing 的常见问题

@apostrophecms/scheduled-publishing 是什么?

Scheduled publishing for ApostropheCMS 3.

如何安装 @apostrophecms/scheduled-publishing?

在项目目录运行 npm install @apostrophecms/scheduled-publishing,或使用 pnpm add / yarn add / bun add。

@apostrophecms/scheduled-publishing 支持 TypeScript 吗?

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

@apostrophecms/scheduled-publishing 支持 ESM 还是 CommonJS?

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

@apostrophecms/scheduled-publishing 可以商用吗?

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

@apostrophecms/scheduled-publishing 的下载量有多少?

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

@apostrophecms/scheduled-publishing 还在维护吗?

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