1.0.2 • Published 10 years ago

require-ext v1.0.2

Weekly downloads
83
License
MIT
Repository
github
Last release
10 years ago

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

ExtensionLoaded Data Type
.jsProgram (Built In)
.jsonObject (Built In)
.txtString
.tplString
.htmlString

Planned Support (Make a pull request!)

ExtensionLoaded Data Type
.csvArray
.hbsCompiled Template

Possible Support (Make a pull request!)

ExtensionLoaded Data Type
.xlsArray
.tsProgram
.jsxProgram
.coffeeProgram