If there is a file already, then the contents in the file are deleted and the input which is given by the user will get updated or if the file is not present, then the file with that will be created in the given path and the input information is written into it. Path − The first parameter is the path of the file or the name of the file into which the input data is to be written. The writeFile() function accepts three parameters − The syntax of this method is as follows − writeFile(path,inputData,callBackFunction) The writeFile() method is used to write into the file in JavaScript. Write operation on a fileĪfter the File System file is imported then, the writeFile() operation is called. The required module is ‘fs’ which is called as File System module in JavaScript. But the module which is required to perform these operations is to be imported. The read and write operations in a file can be done by using some commands.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |