- Create a Blob constructor, pass the data in it to be to save and mention the type of data.
- And finally, call the saveAs(Blob object, “your-file-name. text”) function of FileSaver. js library.
How create js file in Windows?
How to Create a Js File
- Launch “Notepad.”
- Click “File,” “Save” and the “Save As” dialog box is displayed.
- Type “myfile.js” and click the “Save” button. Now you have created a .js file. By adding,
You can place any number of scripts in an HTML document. Scripts can be placed in the , or in the section of an HTML page, or in both.
How run js file in CMD?
- Open Terminal or Command Prompt.
- Set Path to where File is Located (using cd).
- Type “node New. js” and Click Enter.