feat: read files

This commit is contained in:
karishmas6
2024-06-08 21:00:04 +05:30
parent 5a965dd2c6
commit d4d9fab6bb

View File

@@ -81,7 +81,12 @@ function promiseAllP(items: any, block: any) {
return Promise.all(promises);
}
/**
* Reads all files from a directory and returns an array of their contents.
* @param dirname The path to the directory.
* @category WorkflowManagement-Storage
* @returns {Promise<string[]>}
*/
export const readFiles = (dirname: string): Promise<string[]> => {
return new Promise((resolve, reject) => {
fs.readdir(dirname, function(err, filenames) {