Create a runtime directory in Node.js

I’m working on a service which handles file uploads to a server. In my service (Node.js) I want to create a certain file structure, put it in a directory, convert it to a blob and then upload it. I am of course aware of the Node file system (fs), but as far as I know… Read More Create a runtime directory in Node.js

Fs throw error not a direcectory when path is good

This is how function is looking and error code. Can someone see what I’m doing wrong? Here is code: for (const folder of functionFolders) { const functionFiles = fs .readdirSync(`./src/functions/${folder}`) .filter((file) => file.endsWith(‘.js’)); for (const file of functionFiles) { await import(`./src/functions/${folder}/${file}`); } } and error node:fs:1451 handleErrorFromBinding(ctx); ^ Error: ENOTDIR: not a directory, scandir ‘./src/functions/functions.js’… Read More Fs throw error not a direcectory when path is good

Read or select value names from .json file to push in the array

if myjson.js file data: { "key1": [ { "name1": [ "word1", "word2", ], "name2": [ "word3", "word4", ] } ] } loaded: var jsonData = fs.readFileSync("myjson.json", "utf8"); const data = JSON.parse(jsonData); console.log(Object.keys(data)); output: [ ‘key1’ ] or: console.log(Object.values(data)); output: [ [ { name1: [Array], name2: [Array], } ] ] How properly read or select only… Read More Read or select value names from .json file to push in the array