require-ext
v1.0.2
Published
Require handlers for various extensions.
Downloads
1
Maintainers
Readme
require-ext
Require handlers for various extensions.
Install
npm install require-ext
Example
require('require-ext');
var placeholder = require('./placeholder.html');
// [* NOTE ] The extension isn't necessary. require('./placeholder') would work as well.
require('http').createServer(function(req, res){
res.end(placeholder);
}).listen(80);
Currently Supported
| Extension | Loaded Data Type | |:----------|:-----------------------------------------------------------------------| | .js | Program (Built In) | | .json | Object (Built In) | | .txt | String | | .tpl | String | | .html | String |
Planned Support (Make a pull request!)
| Extension | Loaded Data Type | |:----------|:-----------------------------------------------------------------------| | .csv | Array | | .hbs | Compiled Template |
Possible Support (Make a pull request!)
| Extension | Loaded Data Type | |:----------|:-----------------------------------------------------------------------| | .xls | Array | | .ts | Program | | .jsx | Program | | .coffee | Program |