Colleqtor
Seize the directory.
What?
Colleqtor is a simple little Node utility that uses fs
to list the contents of a directory-- with or without filenames, and import the UTF-8 contents of those files into an array-- associative by filename (with or without extension), or sequential.
Where?
Get it on NPM:
npm install colleqtor --save
Or clone this repo:
git clone https://github.com/austinbillings/Colleqtor
How?
Example
Imagine we have a subdirectory called "documents" that contains 5 .txt
files and 2 .log
files. Here's an example:
const colleqtor = require('colleqtor');
let docDir = __dirname + '/documents';
colleqtor.listFiles(docDir);
colleqtor.listFiles(docDir, 'log');
colleqtor.listFiles(docDir, 'log', true);
colleqtor.gatherFileNames(docDir, 'log', true);