fs renaming files
const fs = require("fs")
fs.rename("./testfile.txt", "./newtestfile.txt", (err) => {
if (err) console.log(err)
})
fs renaming files
const fs = require("fs")
fs.rename("./testfile.txt", "./newtestfile.txt", (err) => {
if (err) console.log(err)
})
rename file in js
var fs = require('fs');
fs.rename('sample_old.txt', 'sample_new.txt', function (err) {
if (err) throw err;
console.log('File Renamed.');
});
rename file using node javascript
var fs = require('fs');
fs.rename('mynewfile1.txt', 'myrenamedfile.txt', function (err) {
if (err) throw err;
console.log('File Renamed!');
});
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us