原文链接: brotli js 压缩库
上一篇: webpack 打包一个爬虫小工具
github, 也支持py
https://github.com/google/brotli
测试代码, 零配置的时候
const fs = require('fs')
const brotli = require('brotli')
function test(path) {
let s = fs.readFileSync(path,)
console.log(s.length)
let st = +new Date()
let compressed = brotli.compress(s)
// console.log(compressed)
let ed = +new Date()
console.log(compressed.length, compressed.length / s.length, ed - st)
st = +new Date()