Created
October 12, 2016 03:00
-
-
Save jrainlau/cf7387e283a4f8b5561e0f5bd2c51273 to your computer and use it in GitHub Desktop.
批量复制
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs') | |
let pic = fs.readFileSync(`${__dirname}/dog.jpg`) | |
let readStream = fs.createReadStream(`${__dirname}/dog.jpg`) | |
for (let i = 0; i < 400; i++) { | |
readStream.pipe(fs.createWriteStream(`${__dirname}/输出目录/dog-${i}.jpg`)) | |
} | |
console.log('done') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment