Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to delete everything from a folder in js

const fsPromises = require('fs').promises 
// For ES syntax: import { promises as fsPromises } from 'fs'

const directory = 'your/directory/path/here'

await fsPromises.rmdir(directory, {
  recursive: true
})
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #delete #folder #js
ADD COMMENT
Topic
Name
1+4 =