@hon2a/walk-sync
v0.0.8
Published
Super simple generator that returns absolute paths of all files in a folder and subfolders
Downloads
81
Readme
walk-sync
Super simple generator that returns absolute paths of all files in a folder and sub-folders
Use
npm install @hon2a/walk-sync
import { walkSync } from '@hon2a/walk-sync'
for (const path of walkSync('/path/to/folder')) {
console.log(path)
}
Note that walkSync
is a generator function, so it needs to be used through the iterator.
Development
Install
Install dependencies using:
npm install
Develop
After you modify sources, run the following (or set up your IDE to do it for you):
- format the code using
npm run format
- lint it using
npm run lint
- test it using
npm test
and fix the errors, if there are any.
Publish
Publishing is done in two steps:
- Create a new version tag and push it to the repository:
npm version <patch|minor|major> git push --follow-tags
- Build and publish the new version as a npm package:
npm publish --access public