@axetroy/walk
Version:
58 lines (40 loc) • 1.58 kB
Markdown
## Walk the dir
[](https://greenkeeper.io/)
[](https://travis-ci.org/axetroy/walk)

## Usage
```bash
npm install @axetroy/walk
```
```javascript
const Walker = require('@axetroy/walk');
async function main() {
const walker = new Walker('./');
walker.on('file', function(filepath, stat) {
console.log(filepath);
});
walker.on('directory', function(filepath, stat) {
console.log(filepath);
});
walker.on('error', function(err) {
console.error('something go wrong ' + err.toString());
});
await walker.walk();
}
main()
.then(() => {
console.log('all done');
})
.catch(function(err) {
console.error(err);
});
```
## Contributing
[Contributing Guid](https://github.com/axetroy/walk/blob/master/CONTRIBUTING.md)
## Contributors
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
| [<img src="https://avatars1.githubusercontent.com/u/9758711?v=3" width="100px;"/><br /><sub>Axetroy</sub>](http://axetroy.github.io)<br />[💻](https://github.com/axetroy/walk/commits?author=axetroy) [🐛](https://github.com/axetroy/walk/issues?q=author%3Aaxetroy) 🎨 |
| :---: |
<!-- ALL-CONTRIBUTORS-LIST:END -->
## License
[](https://app.fossa.io/projects/git%2Bgithub.com%2Faxetroy%2Fwalk?ref=badge_large)