Miss any of our Open RFC calls?Watch the recordings here! »

vamtiger-get-directory-content-recursive

0.0.3 • Public • Published

VAMTIGER Get Directory Content Recursive

Get a list of all entries for a defined directory path and respective subdirectories.

Installation

VAMTIGER Get Directory Content Recursive can be installed using npm or yarn:

npm install --save vamtiger-get-directory-content-recursive

or

yarn add vamtiger-get-directory-content-recursive

Usage

Import or require a referece to VAMTIGER Get Directory Content:

import getDirectoryContent from 'vamtiger-get-directory-content-recursive';

or

const getDirectoryContent = require('vamtiger-get-directory-content-recursive').default;

Reference an array of file/directory entries for defined directory path:

getDirectoryContent({
        path: 'some/directory/absolute/path'
    })
    .then(handleResult)
    .catch(handleError);

The result can also be referenced as an object with file and directory classification:

getDirectoryContent({
        path: 'some/directory/absolute/path',
        classified: true
    })
    .then(handleResult)
    .catch(handleError);

Since VAMTIGER Get Directory Content returns a Promise, the result can be more conveniently referenced within an async function:

async someAsyncFunction function() {
    const directoryContent = await getDirectoryContent({
        path: 'some/directory/absolute/path'
    });
}