Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript

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
STAFF
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!

Ken

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

Steven Parker Ken Alger

Steven Parker
Steven Parker
215,939 Points

Bummer...
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