node-file-to-string

0.2.1 • Public • Published

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')

Readme

Keywords

Package Sidebar

Install

npm i node-file-to-string

Weekly Downloads

0

Version

0.2.1

License

MIT

Last publish

Collaborators

  • meodai