Last active
November 10, 2015 11:06
-
-
Save cfsghost/b4d9286f9d89c0c9cb07 to your computer and use it in GitHub Desktop.
This file contains 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
var fs = require('fs'); | |
var qr = require('qr-image'); | |
var co = require('co'); | |
co(function *() { | |
for (var index = 1; index <= 100; index++) { | |
yield function() { | |
return function(done) { | |
var qr_img = qr.image(index, { type: 'png' }); | |
var output = fs.createWriteStream('qrcode-' index '.png'); | |
output.on('finish', function() { | |
done(); | |
}); | |
qr_img.pipe(output); | |
}; | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment