UNPKG

load-templates

Version:
61 lines (41 loc) 1.3 kB
# load-templates [![NPM version](https://badge.fury.io/js/load-templates.svg)](http://badge.fury.io/js/load-templates) > Load templates. ## Install #### Install with [npm](npmjs.org) ```bash npm i load-templates --save ``` ## Run tests ```bash npm test ``` ## Usage ```js var Loader = require('load-templates'); var loader = new Loader(); ``` Throw some disorganized templates into the load method: ```js 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: ```js { '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](./docs/conventions.md) and [tests](./tests) for valid formats. WIP. ## Author **Jon Schlinkert** + [github/jonschlinkert](https://github.com/jonschlinkert) + [twitter/jonschlinkert](http://twitter.com/jonschlinkert) ## License Copyright (c) 2014 Jon Schlinkert, contributors. Released under the MIT license *** _This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on October 23, 2014._