thenify-all

中文文档
1.6.0发布于 2015/01/11MIT近 30 天下载 2.1亿

Promisifies all the selected functions in an object

原始使用文档
文档目录4 节
  1. API
  2. var obj = thenifyAll(source, [obj], [methods])
  3. var obj = thenifyAll.withCallback(source, [obj], [methods])
  4. thenifyAll.thenify

thenify-all

NPM version Build status Test coverage Dependency Status License Downloads Gittip

Promisifies all the selected functions in an object.

var thenifyAll = require('thenify-all');

var fs = thenifyAll(require('fs'), {}, [
  'readFile',
  'writeFile',
]);

fs.readFile(__filename).then(function (buffer) {
  console.log(buffer.toString());
});

API

var obj = thenifyAll(source, [obj], [methods])

Promisifies all the selected functions in an object.

  • source - the source object for the async functions
  • obj - the destination to set all the promisified methods
  • methods - an array of method names of source

var obj = thenifyAll.withCallback(source, [obj], [methods])

Promisifies all the selected functions in an object and backward compatible with callback.

  • source - the source object for the async functions
  • obj - the destination to set all the promisified methods
  • methods - an array of method names of source

thenifyAll.thenify

Exports thenify this package uses.

版本与发布记录

thenify-all 共发布 9 个版本,首次发布于 2014/12/17;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.6.0latest2015/01/1111 年前
1.5.12015/01/0911 年前
1.5.02015/01/0911 年前
1.4.02014/12/2811 年前
1.3.02014/12/2511 年前
1.2.02014/12/2511 年前

关于 thenify-all 的常见问题

thenify-all 是什么?

Promisifies all the selected functions in an object

如何安装 thenify-all?

在项目目录运行 npm install thenify-all,或使用 pnpm add / yarn add / bun add。

thenify-all 支持 TypeScript 吗?

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

thenify-all 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=0.8。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

thenify-all 可以商用吗?

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

thenify-all 的下载量有多少?

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

thenify-all 还在维护吗?

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