https://github.com/iac-factory/walker
File System Walk Event-Emitter
https://github.com/iac-factory/walker
Last synced: 2 months ago
JSON representation
File System Walk Event-Emitter
- Host: GitHub
- URL: https://github.com/iac-factory/walker
- Owner: iac-factory
- License: bsd-2-clause
- Created: 2022-05-27T17:17:35.000Z (about 3 years ago)
- Default Branch: Development
- Last Pushed: 2023-01-08T19:35:08.000Z (over 2 years ago)
- Last Synced: 2025-02-08T17:44:58.679Z (4 months ago)
- Language: TypeScript
- Size: 518 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `@iac-factory/walker` #
*File-Descriptor Event Handler + Listener*
## Usage ##
```node
/*** ESM Module Wrapper for Common-JS (No Additional Configuration Required) */
import("@iac-factory/ecma");import { Listener } from "@iac-factory/walker";
Listener.filter( ( descriptor: FS.Dirent, statistics: FS.Stats ) => {
return !( descriptor.name === "/etc/pam.d" || String( descriptor ) === "/etc/pam.d" );
} ).on( "descriptor" as const as Emitters, function ( descriptor: FS.Dirent, statistics: FS.Stats ) {
console.log( "Descriptor" + ":", descriptor );
} ).on( "directory" as const as Emitters, function (descriptor: FS.Dirent, statistics: FS.Stats ) {
console.log( "Directory" + ":", descriptor );
} ).on( "file" as const as Emitters, function (descriptor: FS.Dirent, statistics: FS.Stats ) {
console.log( "File" + ":", descriptor );
} ).on( "symbolic-link" as const as Emitters, function (descriptor: FS.Dirent, statistics: FS.Stats ) {
console.log( "Symbolic-Link" + ":", descriptor );
} ).on( "block-device" as const as Emitters, function (descriptor: FS.Dirent, statistics: FS.Stats ) {
console.log( "Block-Device" + ":", descriptor );
} ).on( "fifo" as const as Emitters, function (descriptor: FS.Dirent, statistics: FS.Stats ) {
console.log( "FIFO" + ":", descriptor );
} ).on( "socket" as const as Emitters, function (descriptor: FS.Dirent, statistics: FS.Stats ) {
console.log( "Socket" + ":", descriptor );
} ).on( "character-device" as const as Emitters, function (descriptor: FS.Dirent, statistics: FS.Stats ) {
console.log( "Character-Device" + ":", descriptor );
} ).on( "error" as const as Emitters, function ( exception?: Error, descriptor?: FS.Dirent, statistics?: FS.Stats ) {
console.error( "Error" + ":", exception, descriptor, statistics );
} ).on( "end" as const as Emitters, function () {
console.log( "Complete" );
} );Listener.walk( "." );
```## Dependencies ##
> *Where are the 500+ dependencies coming from?*
Dependency management can be hard; especially when it comes to tooling
for development teams to standardize certain practices -- including:- Commit Messages
- Versioning
- Release Lifecycles
- CI-CD Process
- Unit Testing
- Security ScanningTherefore, to understand more accurately the requirement(s) for a given package,
always ensure to check if a lock-file exists. In the specific case of the following
repository, being an `npm` package, that lock file is `package.json` + `package-lock.json`.The **Production** dependencies, or just `dependencies`, is the section to take note of.
In order to prepare a package, generally speaking, for use in a production environment or
downstream package (as of `node` 18.x, `npm` +8):```bash
npm install --omit dev --omit optional --omit peer
```running the command above yields:
```log
up to date, audited 10 packages in 798ms
```