dash-utils

0.1.1 • Public • Published

dash-utils

A common set of utilities for use in the Dash framework (or any node app)

Get Started

npm install dash-utils

or just clone this repo.

Utilities

The module contains the following utilities

Walk

walk(myPath, callback)

is a synchronous function (I know, i know!) that walks the given path recursively and returns all files.

It's used in Dash for walking path trees and pre-loading models and routes when the application bootstraps, thus it being synchronous.

Example:

walk('api/models', function (err, file) {
  if (err) return console.log(err);
  
  if (file == 'api/models/schema.js') {
    // DO SOMETHING
  }
});

escapeRegExp

escapeRegExp()

is just a small utility to help make a string more regexp friendly.

It's used in Dash for making path matches easier.

Readme

Keywords

Package Sidebar

Install

npm i dash-utils

Weekly Downloads

1

Version

0.1.1

License

ISC

Last publish

Collaborators

  • kheide