How to use the directory-tree.directoryTree function in directory-tree

To help you get started, we’ve selected a few directory-tree examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github usebedrock / bedrock / core / discovery / pages.js View on Github external
function discover() {
  const pagesAndFoldersSortedByType = _.chain(dirTree.directoryTree(TEMPLATES_BASE_DIRECTORY, ['.pug']).children)
    .filter(obj => obj.path.charAt(0) !== '_')
    .map(obj => {
      obj = addPageInfo(obj);

      if (obj.children) {
        obj.children = mapChildren(obj.children);
      }

      return obj;
    })
    .sortBy('type')
    .forEach(movePageStatesToParentPage)
    .value();

  return pagesAndFoldersSortedByType.filter(p => !p.path.includes('--'));
}
github titon / toolkit / build / tasks / build-docs.js View on Github external
return new Promise(function(resolve) {
            return resolve(tree('docs/' + locale, ['.md']));
        });
    }))

directory-tree

Convert a directory tree to a JS object.

MIT
Latest version published 4 months ago

Package Health Score

72 / 100
Full package analysis

Popular directory-tree functions