Can l make a file in javascript? | SoloLearn: Learn to code for FREE!

+3

Can l make a file in javascript?

So l has learn javascript in sololearn.But l don't see how to make a file in javascript.So can you help me with that?.

9/26/2020 5:51:33 AM

Ligas Py

22 Answers

New Answer

+7

NodeJS is possible in android from termux, i've been using it. but only limited version are available.

+4

In NodeJS, yes. In web browser-based JavaScript, almost always no. In NodeJS, there are examples writing files at: https://nodejs.dev/learn/writing-files-with-nodejs For web-browser-based JavaScript, you mostly can't write files. The extremely rare exceptions are mentioned at: https://www.c-point.com/JavaScript/articles/file_access_with_JavaScript.htm

+4

------ Dory Node might be another option to explore: --- https://play.google.com/store/apps/details?id=io.tempage.dorynode https://github.com/tempage/dorynode ------ As well as using Termux - as recommended by Rei: --- https://play.google.com/store/apps/details?id=com.termux https://github.com/termux/termux-app

+3

Rei, if defining data for a download link without depending on the server is all Ligas needs, yeah that's a good answer. I wouldn't say that's JavaScript writing a file, though. JavaScript would still have very little control over how that download link works. For example, the browser will determine the directory and likely add a (1), (2)... if a file with the same name already exists. I actually used the trick you're talking about to generate frames for https://www.youtube.com/watch?v=6oTEzDDTsnU from https://code.sololearn.com/WVhoMHzy3K81.

+2

its not allowed in sololearn app, but possible in normal browser

+2

if you have a laptop so,.node.js , p5.js or some options are available or if you have not a laptop only a smartphone so,you can like in Sololearn where html css ..there js is available also so, there you can do it or if you don't like to in js so, you can do js in html also with script tag ....

+1

Josh Greig how about making the files in memory then "download" it ? by using <a href="data:mime/type;encodedFile" />

+1

Ligas said, "That good but in my phone is not allowed" Ligas, you don't have a laptop or desktop? Yes, running NodeJS on a phone is something I never tried. I always program on a laptop or desktop. A big keyboard and screen is very helpful for programming.

+1

And program for android "Spck Editor" it's program don't using internet and it's very nice👌.

+1

I didn't understand the question. Do you want to include .js file or create any file using js

0

thanks buddy

0

and how l can get NodeJS

0

That good but in my phone is not allowed

0

still not going

0

That's good

0

its just a possible workaround that i think worth mentioning, thanks for more clarification Josh Greig on that :D

0

Greig, l don't have any laptop or desktop but l can go to any store to borrow any desktop.

0

Rei, good idea let me try

0

Yes you can make file

0

You can make JavaScript file name: "file name".js. And I was like sublime text it's program very nice to web-programmer.