Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

9 Commits

Repository files navigation

simple-walker

simple-walker is a nodejs synchronous walker to search files inside dirs. It's specially designed to load dynamic files, like routes, modules, etc.

Installation

You can download the repository or simply install this module through npm:

npm install simple-walker

Usage

Include the module through import:

import walker from 'simple-walker';

You then have a reference to a function, which takes the following arguments:

walker ( path, dirname, filename );

Whereas path is the location to inspect, dirname is the dirname to search and filename is the filename to search inside dirname.

Example

// Import the packageimportwalkerfrom'simple-walker';// Apps endopointsconstappsRoutes=walker(path.join('/project_name','/apps'),'endpoints','routes.js');exportdefaultfunction(app){// Initialize Express's routesfor(letrouteofappsRoutes){app.use(`/api/v1/`,require(route.path));}}

About

A simple walker for directories and files

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages