Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
var sys = require("sys"),
fs = require("fs");
function processImageDir(path, outFilename, cb) {
fs.readdir(path, function(err, files) {
fs.writeFile(__dirname + '/' + outFilename, JSON.stringify({
images: files.filter(function(name) { return /(?:png|jpe?g|gif)$/i.test(name); })
}), function(err) {
if (err) throw err;
cb && cb("Sweet.");
});
});
}
processImageDir('/path/to/your/images/dir', "preload-images.json", function(message) {
console.log(message);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.