From 5a0630aa89f0a9194e7bbae5d862712c877bb12e Mon Sep 17 00:00:00 2001 From: Veronica Manuel Date: Wed, 17 May 2023 14:50:18 +0000 Subject: [PATCH] GITBOOK-139: change request with no subject merged in GitBook --- .../make-a-boss-c2d-algorithm.md | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/how-tos/compute-to-data/make-a-boss-c2d-algorithm.md b/how-tos/compute-to-data/make-a-boss-c2d-algorithm.md index f89c47b1..776d79f8 100644 --- a/how-tos/compute-to-data/make-a-boss-c2d-algorithm.md +++ b/how-tos/compute-to-data/make-a-boss-c2d-algorithm.md @@ -48,3 +48,28 @@ with open(input_filename, 'r') as file: ``` ### Javascript + +``` +const fs = require("fs"); + +var input_folder = "/data/inputs"; +var output_folder = "/data/outputs"; + +async function processfolder(Path) { + var files = fs.readdirSync(Path); + for (var i =0; i < files.length; i++) { + var file = files[i]; + var fullpath = Path + "/" + file; + if (fs.statSync(fullpath).isDirectory()) { + await processfolder(fullpath); + } else { + + } + } +} + + + +processfolder(input_folder); + +```