pwny
Pwny (pronounced pony) helps makes your Express apps modular and maintainable.
Installation
$ npm install pwny
Using pwny
Rather than this moderate mess:
var bodyParser = express = morgan = ; var app = ; app;app; morgan; app; app;
You can clean things up using Pwny:
app.js
var express = pwny = ; var app = ; ; app;
config/initializers/bodyParser.js
var bodyParser = ; module { app; app;};
config/initializers/morgan.js
var morgan = module { morgan; app;};
As you can see, Pwny allows you to keep your Express modules sparkly clean and logically separated.
Configuration
You can tell Pwny where to look by passing a path to the configPath
option.
;
Sometimes order matters. To specify an order in which your config files load you can pass in an order
array.
;
Note that by specifying an order Pwny will only load specified files.
; // will not load bodyParser
.pwnyrc
You can also configure Pwny by adding a JSON .pwnyrc
file to your app's root directory.