Skip to content

Cross-Platform NodeJS module that exports a function that can retrieve the contents (filenames/dirnames) of a given target path and all its subdirectories.

License

Notifications You must be signed in to change notification settings

mahdifani14/path-content-retriever

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PathContentRetriever

Cross-Platform NodeJS module that exports a function that can retrieve the contents (filenames/dirnames) of a given target path and all its subdirectories. The function returns a Javascript object with 2 array properties.

Installation

npm install content-retriever --save

Usage

  var contentRetriever = require('content-retriever');

  contentRetriever.run('node_modules/content-retriever/example').then((res) => {
      console.log(res);
    })

Example Output

{ filenames:
   [ 'node_modules/content-retriever/example/example.js',
     'node_modules/content-retriever/example/foo/bar/bar1.txt',
     'node_modules/content-retriever/example/foo/bar/bar2.txt',
     'node_modules/content-retriever/example/foo/f1.txt',
     'node_modules/content-retriever/example/foo/f2.txt' ],
  dirnames:
   [ 'node_modules/content-retriever/example',
     'node_modules/content-retriever/example/foo',
     'node_modules/content-retriever/example/foo/bar',
     'node_modules/content-retriever/example/foo/bar/baz' ] }

Test

npm test

Release History

  • 1.0.1 Initial release

About

Cross-Platform NodeJS module that exports a function that can retrieve the contents (filenames/dirnames) of a given target path and all its subdirectories.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published