June 2014
Intermediate to advanced
696 pages
38h 52m
English
You may need to rename files and folders in you Node.js application to make room for new data, archive old data, or apply changes made by a user. Renaming files and folders uses the following fs calls:
fs.rename(oldPath, newPath, callback)fs.renameSync(oldPath, newPath)
The oldPath parameter specifies the existing file or directory path, and the newPath parameter specifies the new name. The renameSync(path) function returns true or false, depending on whether the file or directory was successfully renamed. On the other hand, an asynchronous rename() call passes an error value to the callback function if an error is encountered when renaming the file or directory.
The following code ...
Read now
Unlock full access