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
// npm i axios | |
const axios = require('axios').default; | |
axios.interceptors.request.use( x => { | |
// to avoid overwriting if another interceptor | |
// already defined the same object (meta) | |
x.meta = x.meta || {} | |
x.meta.requestStartedAt = new Date().getTime(); | |
return x; |
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
function readDir(start, callback) { | |
// Use lstat to resolve symlink if we are passed a symlink | |
fs.lstat(start, function(err, stat) { | |
if(err) { | |
return callback(err); | |
} | |
var found = {dirs: [], files: []}, | |
total = 0, | |
processed = 0; | |
function isDir(abspath) { |