Ask coding questions

← Back to all posts
How to create a collaborative text editor in node.js? please help me!
PixiGem

How to create a collaborative text editor in node.js?

It has been a week since I've been searching for tutorials on the web but couldn't find a good one.

Yeah Ima node.js newbie, my most recent node.js project was a chatroom

PLEASE HELP Meh!

... I think @coder100 can coz he is a full-stack dev in node.js (Sorry For The Ping)

Voters
GameDev46
PixiGem
Comments
hotnewtop
GameDev46

This sounds like a cool and interesting project, good luck with it XD SO as a base you would need to have a website use fetch requests with a simple node.js server. So as a start you would need to understand a basic express API, there is a good tutorial here:

https://www.youtube.com/watch?v=pKd0Rpw7O48

So once you have watched that (or already understand express API) you need to learn about fs file reading and saving here:

https://www.w3schools.com/nodejs/nodejs_filesystem.asp

Now you can read and write files with node.js and fs! So now things get easier, with the API you can setup a path which response with the files contents by reading and writing it on the page. And one where you use the URL extension to get data from a URL and rewrite the file to contains its new value! To read about the URL extension go here:

https://www.w3schools.com/nodejs/nodejs_url.asp

And Ta-da you can now request and write new data in a file on a server! Now all you have to do is make fetch requests to the server to update the contents, such as:

and do the same for adding text except

PixiGem

@GameDev46 well this is looking kinda.....

HARD!!

Yeah, but there is no other way...

TBH ima node.js beginner, I need a bit more explanation...

GameDev46

@HyperDev100 Yes, for this kind of project it will be XD The YouTube video will definitely help you as it is aimed at beginners and if there is anything you don’t know then you can ask me or the community =D