frs
npm library for file recursive search
(This repository is a WIP)
Usage
Both functions return Promise.
const { getAbsolutePathList, getFileNameList } = require('frs');
(async () => {
const absolutePathList = await getAbsolutePathList('./testdata');
console.log({ absolutePathList });
const fileNameList = await getFileNameList('./testdata');
console.log({ fileNameList });
})();
โ
{
absolutePathList: [
'testdata/dir1/dir2/test2.txt',
'testdata/dir1/dir2/test6.txt',
'testdata/dir1/dir3/dir4/dir5/dir6/test8.txt',
'testdata/dir1/dir3/dir4/dir5/dir6/test9.txt',
'testdata/dir1/dir3/dir4/dir5/test7.txt',
'testdata/dir1/dir3/dir4/test5.txt',
'testdata/dir1/dir3/test3.txt',
'testdata/dir1/dir3/test4.txt',
'testdata/dir1/test1.txt'
]
}
{
fileNameList: [
'test2.txt', 'test6.txt',
'test8.txt', 'test9.txt',
'test7.txt', 'test5.txt',
'test3.txt', 'test4.txt',
'test1.txt'
]
}
Install
npm install frs
# or
yarn add frs
Command
Test
npm run test
Code Format
npm run fmt