https://github.com/simov/recursive-fs
Asynchronous recursive file system operations
https://github.com/simov/recursive-fs
Last synced: 9 months ago
JSON representation
Asynchronous recursive file system operations
- Host: GitHub
- URL: https://github.com/simov/recursive-fs
- Owner: simov
- License: mit
- Created: 2013-01-13T16:07:47.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2021-11-15T14:04:30.000Z (about 4 years ago)
- Last Synced: 2025-04-01T22:40:29.252Z (10 months ago)
- Language: JavaScript
- Homepage:
- Size: 33.2 KB
- Stars: 7
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# recursive-fs
[![npm-version]][npm] [![travis-ci]][travis] [![coveralls-status]][coveralls]
> _Asynchronous Recursive File System Operations_
## read
```js
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
```js
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
```js
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
```bash
npx recursive-copy 'path/to/source/directory' 'path/to/destination/directory'
```
## recursive-delete
```bash
npx recursive-delete 'path/to/directory'
```
[npm-version]: https://img.shields.io/npm/v/recursive-fs.svg?style=flat-square (NPM Package Version)
[travis-ci]: https://img.shields.io/travis/simov/recursive-fs/master.svg?style=flat-square (Build Status - Travis CI)
[coveralls-status]: https://img.shields.io/coveralls/simov/recursive-fs.svg?style=flat-square (Test Coverage - Coveralls)
[npm]: https://www.npmjs.com/package/recursive-fs
[travis]: https://travis-ci.org/simov/recursive-fs
[coveralls]: https://coveralls.io/github/simov/recursive-fs