1.2.0 • Published 4 years ago

node-recursive-directory v1.2.0

Weekly downloads
266
License
ISC
Repository
github
Last release
4 years ago

node-recursive-directory

Npm package to get directory files recursively

Usage:

Just list of files

const getFiles = require('node-resursive-directory');

(async () => {
    const files = await getFiles('/home');
    console.log(files);
})

Get list of files as object with parsed data:

const getFiles = require('node-resursive-directory');

(async () => {
    const files = await getFiles('/home', true); // add true
    console.log(files);
})

You will get something like that:

  [
      ...,
      {
        fullpath: '/home/vvm/Downloads/images/Some/Some Image.jpg',
        filepath: '/home/vvm/Downloads/images/Some/',
        filename: 'Some Image.jpg',
        dirname: 'Some'
    },
  ]