Web 文件流

节点的文件流 APIs for the web.
import {WebFileStream} from '@cubbit/web-file-stream';
const file = new File(['My test file'], 'test-file.txt', {
type: 'text/plain'
});
const read_stream = WebFileStream.create_read_stream(file);
read_stream.on('error', console.error);
read_stream.on('data', (data) => console.log(data));
read_stream.on('end', () => console.log('File read!'));
安装
这是一个通过 npm 注册提供的模块 . 安装使用 npm 安装命令 :
npm install @cubbit/web-file-stream
特征
测试
要运行测试套件,首先安装依赖,然后运行 npm 测试:
npm install
npm test