Nothing Particularly Magnificent
Miss any of our Open RFC calls?Watch the recordings here! »

require-ext

1.0.2 • Public • Published

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

Install

npm i require-ext

DownloadsWeekly Downloads

130

Version

1.0.2

License

MIT

Last publish

Collaborators

  • avatar