Created
December 27, 2019 16:31
-
-
Save Shafran123/95af60d20324aab352e1180d0cf9bbe8 to your computer and use it in GitHub Desktop.
How to write a json file using node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs') | |
const book = { | |
title : 'Ego is the Enemy', | |
author : 'Rayan Holiday' | |
} | |
const bookJSON = JSON.stringify(book) | |
fs.writeFileSync('1.json' , bookJSON) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment