An open API service indexing awesome lists of open source software.

https://github.com/jsreport/jsreport-templates

jsreport extension adding support for storing templates
https://github.com/jsreport/jsreport-templates

Last synced: about 1 year ago
JSON representation

jsreport extension adding support for storing templates

Awesome Lists containing this project

README

          

**⚠️ This repository is deprecated since jsreport v3, its features has been integrated directly to [@jsreport/jsreport-core](https://github.com/jsreport/jsreport/tree/master/packages/jsreport-core) and [@jsreport/jsreport-studio](https://github.com/jsreport/jsreport/tree/master/packages/jsreport-studio)**
--

# jsreport-templates
[![NPM Version](http://img.shields.io/npm/v/jsreport-templates.svg?style=flat-square)](https://npmjs.com/package/jsreport-templates)
[![Build Status](https://travis-ci.org/jsreport/jsreport-templates.png?branch=master)](https://travis-ci.org/jsreport/jsreport-templates)

Templates extension hooks to the rendering process and finds the template in the persistent storage if the request identifies the template by its name or shortid.
```js
jsreport.render({ template: { name: 'name' } })
jsreport.render({ template: { shortid: 'shortid' } })
```

It also extends [jsreport studio](https://github.com/jsreport/jsreport-express) and its REST API with odata endpoint:

> `GET` http://jsreport-host/odata/templates

## jsreport-core
You can apply this extension also manually to [jsreport-core](https://github.com/jsreport/jsreport-core)

```js
var jsreport = require('jsreport-core')()
jsreport.use(require('jsreport-templates')())
```