0.2.3 • Published 9 years ago

node-raw v0.2.3

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

⚠ Heads up! This module has been deprecated. Have a look at isomorphic-ensure and use raw-loader directly.


Coveralls – test coverage
Travis – build status
David – status of dependencies
Code style: airbnb

node-raw

Make webpack’s raw-loader work in node and iojs.

And that almost for free. The whole thing weighs around 300 bytes minzipped.

Installation

$ npm install node-raw

Usage

1) Shim require.

const grab = require('node-raw')(require, {dirname: __dirname});

2) Profit!

// Require modules as you did normally.
const Rx = grab('rx');

// Require text files with *raw-loader*. That’ll now work in node as well!
const readme = grab('raw!./Readme.md');

3) Hot tip!

This works well with node-ensure:

if (!grab.ensure) grab.ensure = require('node-ensure');

Caveats

I’m having some weird problems with requiring files directly from node_modules (like in grab('raw!node-raw/Readme.md)). For relative files everything works like a charm and can be considered stable.

License

MIT © Tomek Wiszniewski

0.2.3

9 years ago

0.2.2

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago