研究 node lzma 的压缩解压缩
作者:互联网
/* eslint-disable */
// // 压缩为 lzma
// var fs = require('fs');
// var lzma = require('lzma-native');
// var compressor = lzma.createCompressor();
// var input = fs.createReadStream('README.md');
// var output = fs.createWriteStream('README.md.lzma');
// input.pipe(compressor).pipe(output);
// // 解压 lzma
// var fs = require('fs');
// var lzma = require('lzma-native');
// var compressor = lzma.createDecompressor();
// var input = fs.createReadStream('README.md.lzma');
// var output = fs.createWriteStream('README2.md');
// input.pipe(compressor).pipe(output);
// // 压缩为 lzma
// // https://github.com/nickdesaulniers/lzma-stream
// var fs = require('fs');
// var lzma = require('lzma-stream'); // 下载仓库作为 lzma-stream require
// var compressor = new lzma.LZMACompressionStream;
// var decompressor = new lzma.LZMADecompressionStream;
// var output = fs.createWriteStream('a.lzma');
// fs.createReadStream('./a.txt')
// .pipe(compressor)
// .pipe(output);
标签:node,lzma,fs,require,解压缩,pipe,compressor,var 来源: https://www.cnblogs.com/daysme/p/11116911.html