JSPM

  • Created
  • Published
  • Downloads 51958
  • Score
    100M100P100Q178256F

Load templates.

Package Exports

  • load-templates

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (load-templates) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

load-templates NPM version

Load templates.

Install with npm

npm i load-templates --save

Run tests

npm test

Usage

var Loader = require('load-templates');
var loader = new Loader();

Throw some disorganized templates into the load method:

loader.load('a.md', {a: 'b'});
loader.load('*.md', {a: 'b'});
loader.load(['*.md'], {a: 'b'});
loader.load({path: 'a.md', a: 'b'});
loader.load({'a.md': {path: 'a.md', a: 'b'}});

And get shiny, normalized template objects back:

{ 'a.md': {path: 'a.md', content: 'this is content.', a: 'b'},
  'b.md': {path: 'b.md', content: 'this is content.', a: 'b'},
  'c.md': {path: 'c.md', content: 'this is content.', a: 'b'}}

Valid formats

See the docs and tests for valid formats. WIP.

Author

Jon Schlinkert

License

Copyright (c) 2014 Jon Schlinkert
Released under the MIT license


This file was generated by verb on December 05, 2014.