Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'use strict';
const Promise = require('bluebird');
const Path = require('path');
const co = require('co');
const _ = require('lodash');
const fs = Promise.promisifyAll(require('fs'));
const readFile = Promise.promisify(fs.readFile);
const isBinary = Promise.promisify(require('istextorbinary').isBinary);
const utils = require('./utils');
const glob = require('globby');
const notBinary = ['.nunj', '.nunjucks', '.hbs', '.handlebars', '.jsx', '.twig']; // TODO: handle this in a scalable, extendable way
module.exports = {
describe(dir, relDir, filter) {
filter = filter || (filePath => !(/(^|\/)\.[^\/\.]/g).test(filePath));
return dirscribe(dir, {
filter: filter,
after: files => _.orderBy(files, ['isDirectory', 'order', 'path'], ['desc', 'asc', 'asc']),
build: build,
});
'use strict';
const Promise = require('bluebird');
const Path = require('path');
const co = require('co');
const _ = require('lodash');
const dirscribe = require('@allmarkedup/dirscribe');
const fs = require('fs');
const readFile = Promise.promisify(fs.readFile);
const isBinary = Promise.promisify(require('istextorbinary').isBinary);
const utils = require('./utils');
const console = require('./console');
module.exports = {
describe(dir, noCache) {
dir = Path.resolve(dir);
return dirscribe(dir, {
filter: filePath => !(/(^|\/)\.[^\/\.]/g).test(filePath),
after: files => _.orderBy(files, ['type', 'order', 'path'], ['desc', 'asc', 'asc']),
build: build
});
function build(filePath, stat) {