dash-utils
v0.1.1
Published
a set of common utility functions that can be used in a dash/express application
Downloads
4
Readme
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.