0.2.1 • Published 9 years ago

node-file-to-string v0.2.1

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

node-file-to-string

node helper that outputs whatever file (html, xml, svg etc..) as a string. Using a cache, and automatic transformers by file-type

Installation

npm install node-file-to-string --save

Usage

Usage in Node / Gulp / Grunt

jadeInline = require('node-file-to-string')();

Make use of transformers

marked = require('marked');
jadeInline = require('node-file-to-string')({
    md: marked
});
/* files ending with *.md will be parsed with marked before returned */

make sure to pass the function to your jade data.

jade.compile('string of jade', { globals: { helpers: {inline: jadeInline} }});

Inside a jade file

!= helpers.inline('somefile.svg')