Jeff Williams 0fa28300b2 refactor: reorganize @jsdoc/core
Also creates a new package, `@jsdoc/cli`.

BREAKING CHANGE: Methods in `@jsdoc/core` moved around.
2019-12-08 18:30:58 -08:00

20 lines
429 B
JavaScript

/**
* @module @jsdoc/util/lib/fs
*/
const _ = require('lodash');
const klawSync = require('klaw-sync');
const path = require('path');
exports.lsSync = ((dir, opts = {}) => {
const depth = _.has(opts, 'depth') ? opts.depth : -1;
const files = klawSync(dir, {
depthLimit: depth,
filter: (f => !path.basename(f.path).startsWith('.')),
nodir: true
});
return files.map(f => f.path);
});