From 719d40cae04aa3beee29d210d91bad31e15d10f7 Mon Sep 17 00:00:00 2001 From: FarhanYaseen Date: Mon, 15 Oct 2018 17:14:31 +0500 Subject: [PATCH] Updated write file code with proper indentation (#19212) * Updated write file code with proper indentation Updated with proper style match and indentation * Update index.md --- .../guide/english/nodejs/file-system/index.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/client/src/pages/guide/english/nodejs/file-system/index.md b/client/src/pages/guide/english/nodejs/file-system/index.md index db649ace3f..1138b708ae 100644 --- a/client/src/pages/guide/english/nodejs/file-system/index.md +++ b/client/src/pages/guide/english/nodejs/file-system/index.md @@ -27,12 +27,12 @@ Node.js code to read file from your computer and return the content to the conso ```javascript const fs = require('fs'); fs.readFile('input.txt', 'utf-8', (err, data) => { - if(err){ - console.log(err); - } - else{ - console.log("Content present in input.txt file : " + data.toString()); - } + if (err) { + console.log(err); + } + else { + console.log("Content present in input.txt file : " + data.toString()); + } }); ``` The above code reads a file *input.txt* from your computer and returns the content to the console. @@ -55,12 +55,12 @@ Node.js code to write content into file. ```javascript const fs = require('fs'); fs.writeFile('output.txt', "New content added", (err, data) => { - if(err){ - console.log(err); - } - else{ - console.log("The file is saved"); - } + if (err) { + console.log(err); + } + else { + console.log("The file is saved"); + } }); ``` The above code creates a file *output.txt* and add content *New content added* to it.