Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

node rename

const fs = require('fs')

oldPath = './wiki/old.txt'
newPath = './wiki/new.txt'

// Sync
fs.renameSync(oldPath, newPath)

// Async
fs.rename(oldPath, newPath, (error) => {
  if (error) { console.log(error) }
  else { /* Success! Now do something else. */ }
})
Comment

PREVIOUS NEXT
Code Example
Javascript :: theme ui with react 17 
Javascript :: use anchor element to open file 
Javascript :: get html element coords with js 
Javascript :: set angle in phaser 
Javascript :: change y scale phaser 
Javascript :: vuejs.org español 
Javascript :: phaser place on part of circle 
Javascript :: phaser wrap in camera bounds 
Javascript :: phaser hide animation on complete 
Javascript :: phaser stagger play 2 
Javascript :: Node.js technical interview samples 
Javascript :: Clean way to remove text and keep div inside a div jquery 
Javascript :: file size to string js 
Javascript :: React "Nothing was returned from render Error" Solution 
Javascript :: condition rendering using if-else 
Javascript :: how to used xpath snapshot in loop 
Javascript :: Slice and Splice -Javascript 2 
Javascript :: javascript check item is checkbox 
Javascript :: javascript break with while Loop 
Javascript :: how to add google map in react js 
Javascript :: create a class variable js 
Javascript :: javascript find json value 
Javascript :: vanilla js 
Javascript :: array and array compare 
Javascript :: firebase realtime database increment value 
Javascript :: open modal using jquery 
Javascript :: js a function that takes in multiple arguments. 
Javascript :: rest operator in javascript 
Javascript :: for in in javascript 
Javascript :: javascript camelcase regex 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =