node-useful

Node.js 工具方法。点击查看在线文档

npm Build and Deploy Docs codecov GitHub

安装

npm install node-useful
yarn add node-useful
pnpm add node-useful

使用

import { getBuffer } from 'node-useful';

async function something() {
  const buf = await getBuffer('xxx');
  // next ...
}

API

  • bufferToStream - buffer 转 stream
  • streamToBuffer - stream 转 buffer
  • getBuffer - 获取本地或远程文件 buffer