0.1.1 • Published 8 years ago

dash-utils v0.1.1

Weekly downloads
-
License
ISC
Repository
-
Last release
8 years ago

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.

0.1.1

8 years ago

0.1.0

8 years ago