2.0.1 • Published 4 months ago
@anio-js-foundation/fs-scandir-sync v2.0.1
@anio-js-foundation/fs-scandir-sync
Scans a directory recursively:
import scandir from "@anio-js-foundation/fs-scandir-sync"
console.log(
scandir(".")
)
[
{
type: 'file',
relative_path: 'README.md',
absolute_path: '/home/dasdeo/fs-scandir-sync/README.md'
},
{
type: 'file',
relative_path: 'index.mjs',
absolute_path: '/home/dasdeo/fs-scandir-sync/index.mjs'
},
{
type: 'file',
relative_path: 'package.json',
absolute_path: '/home/dasdeo/fs-scandir-sync/package.json'
}
]
Output order can be reversed by calling scandir.reverse
.
This is useful for deleting directories.