@cypress/xvfb

中文文档
1.2.4发布于 2018/09/29MITCommonJS近 30 天下载 2344.7万

Easily start and stop an X Virtual Frame Buffer from your node apps.

原始使用文档
文档目录4 节
  1. @cypress/xvfb
  2. Usage
  3. Debugging
  4. Thanks to

@cypress/xvfb

easily start and stop an X Virtual Frame Buffer from your node apps.

CircleCI Build Status semantic-release renovate-app badge

Usage

var Xvfb = require('xvfb');
var options = {}; // optional
var xvfb = new Xvfb(options);
xvfb.start(function(err, xvfbProcess) {
  // code that uses the virtual frame buffer here
  xvfb.stop(function(err) {
    // the Xvfb is stopped
  });
});

The Xvfb constructor takes four options:

  • displayNum - the X display to use, defaults to the lowest unused display number >= 99 if reuse is false or 99 if reuse is true.
  • reuse - whether to reuse an existing Xvfb instance if it already exists on the X display referenced by displayNum.
  • timeout - number of milliseconds to wait when starting Xvfb before assuming it failed to start, defaults to 2000.
  • silent - don't pipe Xvfb stderr to the process's stderr.
  • xvfb_args - Extra arguments to pass to Xvfb.
  • onStderrData - Function to receive stderr output

Debugging

Run with DEBUG=xvfb environment variable to see debug messages. If you want to see log messages from the Xvfb process itself, use DEBUG=xvfb,xvfb-process.

Thanks to

Forked from node-xvfb

both of which served as inspiration for this package.

版本与发布记录

@cypress/xvfb 共发布 16 个版本,首次发布于 2017/06/22;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.2.4latest2018/09/298 年前
1.2.32018/04/218 年前
1.2.22017/12/288 年前
1.2.12017/12/288 年前
1.2.02017/12/288 年前
1.1.42017/12/278 年前

关于 @cypress/xvfb 的常见问题

@cypress/xvfb 是什么?

Easily start and stop an X Virtual Frame Buffer from your node apps.

如何安装 @cypress/xvfb?

在项目目录运行 npm install @cypress/xvfb,或使用 pnpm add / yarn add / bun add。

@cypress/xvfb 支持 TypeScript 吗?

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

@cypress/xvfb 支持 ESM 还是 CommonJS?

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

@cypress/xvfb 可以商用吗?

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

@cypress/xvfb 的下载量有多少?

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

@cypress/xvfb 还在维护吗?

最新版本 1.2.4 发布于 2018/09/29(8 年前);至今共发布 16 个版本,其中过去 12 个月发布了 0 个;首次发布于 2017/06/22。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。