Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial


How can i send a table row data to a txt file with node js?

Hi. I’m building some kind of tool manager as a practice project. how it’s working? I have 2 tables : 1 table for tools that is being taken currently and another table which is the logs table. I want to send every time the user click on the “delete log button” the data in the table to a txt file. I’m currently not at home and i upload my workspace here but i have done some research about this topic and there is the “fs” library in node js but i don’t fully get how i can send the data from the logs

i will appreciate any info about this topic, thanks

Steven Parker

3 Answers

Ken Alger
Ken Alger
Treehouse Teacher

Just conceptually:

1) Grab the data that will be "deleted" from the tools table.
2) Save the "deleted" data to the logs table.
3) Delete it from the tools table.

Hard to write the code for your specific use case without knowing the table structure, current code base, etc.

Happy coding!


THIS IS THE CURRENTR SNAPSHOT: https://w.trhou.se/pvrld46iw6

Steven Parker Ken Alger

Steven Parker
Steven Parker
230,230 Points

The Workspace Snapshot you are looking for doesn't exist.

this is the most up to date version: https://w.trhou.se/z6jgmyj5ho

the main files are mainapp.js, index.html,style.css