recursive-fs
v2.1.0
Published
Asynchronous recursive file system operations
Downloads
698,766
Maintainers
Readme
recursive-fs
Asynchronous Recursive File System Operations
read
var rfs = require('recursive-fs')
var path = require('path')
var directory = path.resolve(process.cwd(), process.argv[2])
;(async () => {
try {
var {dirs, files} = await rfs.read(directory)
console.log(dirs)
console.log(files)
console.log('DONE!')
}
catch (err) {
console.error(err)
}
})()
remove
var rfs = require('recursive-fs')
var path = require('path')
var directory = path.resolve(process.cwd(), process.argv[2])
;(async () => {
try {
await rfs.remove(directory)
console.log('DONE!')
}
catch (err) {
console.error(err)
}
})()
copy
var rfs = require('recursive-fs')
var path = require('path')
var source = path.resolve(process.cwd(), process.argv[2])
var destination = path.resolve(process.cwd(), process.argv[3])
;(async () => {
try {
await rfs.copy(source, destination)
console.log('DONE!')
}
catch (err) {
console.error(err)
}
})()
recursive-copy
npx recursive-copy 'path/to/source/directory' 'path/to/destination/directory'
recursive-delete
npx recursive-delete 'path/to/directory'