Node.js 链流 ES6 字符串String 方法startsWith ES6 字符串String 方法 endsWith Node.js 链流 var fs = require("fs"); var zlib = require('zlib'); // Compress the file input.txt to input.txt.gz fs.createReadStream('input.txt') .pipe(zlib.createGzip()) .pipe(fs.createWriteStream('input.txt.gz')); console.log("File Compressed."); ES6 字符串String 方法startsWith ES6 字符串String 方法 endsWith