Top "Fs" questions

File I/O in the Node.

How to create full path with node's fs.mkdirSync?

I'm trying to create a full path if it doesn't exist. The code looks like this: var fs = require('fs'); …

node.js fs
Writing JSON object to a JSON file with fs.writeFileSync

I am trying to write a JSON object to a JSON file. The code executes without errors, but instead of …

json node.js file fs
Using filesystem in node.js with async / await

I would like to use async/await with some filesystem operations. Normally async/await works fine because I use babel-plugin-syntax-async-functions. …

javascript node.js async-await fs
Read file from aws s3 bucket using node fs

I am attempting to read a file that is in a aws s3 bucket using fs.readFile(file, function (err, …

node.js amazon-web-services amazon-s3 fs
Node.js Write a line into a .txt file

I want to create a simple Log System, which prints a line before the past line into a txt file …

node.js fs
NodeJS accessing file with relative path

It seemed like a straight forward problem. But I amn't able to crack this. Within helper1.js I would like …

node.js express fs
Looping through files in a folder Node.JS

I am trying to loop through and pick up files in a directory, but I have some trouble implementing it. …

javascript arrays node.js loops fs
How to close a readable stream (before end)?

How to close a readable stream in Node.js? var input = fs.createReadStream('lines.txt'); input.on('data', function(data) { // …

node.js stream fs
writeFile no such file or directory

I have a file(data.file an image), I would like to save this image. Now an image with the …

node.js fs
App base path from a module in NodeJS

I'm building a web app in NodeJS, and I'm implementing my API routes in separate modules. In one of my …

node.js module path fs