rizidoro rizidoro - 12 days ago 8
Node.js Question

How I move files on node.js?

How can I move files (like mv command shell) on node.js? Is there any method for that or I need to read a file, write to new file and remove older file?

Answer

According to seppo0010 comment, I used the rename function to do that.

http://nodejs.org/docs/latest/api/fs.html#fs_fs_rename_oldpath_newpath_callback

Thanks