json-dir-listing
Version:
Tool to generate JSON directory listings
21 lines (17 loc) • 407 B
JavaScript
var crypto = require('crypto');
var fs = require('fs');
var Promise = require('bluebird');
function doesFileExist(filename) {
return new Promise(function(resolve) {
fs.exists(filename, function(exists) {
return resolve(exists);
});
});
}
function randKey() {
return crypto.randomBytes(20).toString('hex');
}
module.exports = {
doesFileExist : doesFileExist,
randKey : randKey,
};