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
- Host: GitHub
- URL: https://github.com/jsreport/jsreport-templates
- Owner: jsreport
- License: lgpl-3.0
- Created: 2015-11-05T18:43:50.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2021-11-24T18:20:29.000Z (over 4 years ago)
- Last Synced: 2025-03-27T11:43:34.374Z (about 1 year ago)
- Language: JavaScript
- Size: 693 KB
- Stars: 2
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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
[](https://npmjs.com/package/jsreport-templates)
[](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')())
```