list-paths
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

list-paths

Build Status npm version codecov Mutation testing badge

Node package to fetch all paths in the working directory.

Also accepts a sub-directory path and returns all paths within.

Ready to use out of the box.

Install

$ npm install list-paths

Usage

Find all paths in the working directory.

const listPaths = require('list-paths')
const dir = listPaths() // [ './', './public', './src', './src/helpers', 'etc...' ]

Find all paths in a sub-directory.

const listPaths = require('list-paths')
const dir = listPaths('./src') // [ './src', './src/helpers', 'etc...' ]

API

listPaths accepts 2 parameters, path & an options object.

listPaths(path, { ignoreNodeModules, ignoreGit, useGitIgnore, includeFiles }) => {string[]}
Parameter Type Default Description
path string "." The directory path to searched.
ignoreNodeModules boolean true If true, ignores 'node_modules' folder.
ignoreGit boolean true If true, ignores '.git' folder.
useGitIgnore boolean true If true, ignores paths in '.gitignore'.
includeFiles boolean false If true, includes file paths.

Authors

Tim Dunphy

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Package Sidebar

Install

npm i list-paths

Weekly Downloads

1,147

Version

1.0.2

License

MIT

Unpacked Size

10.5 kB

Total Files

7

Last publish

Collaborators

  • meanboycousin