https://github.com/superraytin/underscore.template
Extracted template from Underscore, use "_.template" without full underscore source.
https://github.com/superraytin/underscore.template
Last synced: about 2 months ago
JSON representation
Extracted template from Underscore, use "_.template" without full underscore source.
- Host: GitHub
- URL: https://github.com/superraytin/underscore.template
- Owner: superRaytin
- License: mit
- Created: 2015-12-24T03:28:09.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-11-06T21:09:13.000Z (over 5 years ago)
- Last Synced: 2025-04-07T10:47:07.538Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 19.5 KB
- Stars: 4
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# underscore.template
> Extracted template from [Underscore](http://underscorejs.org/), use `_.template` without full underscore source.[![NPM version][npm-image]][npm-url]
[![Downloads][downloads-image]][npm-url]
[![Bower version][bower-image]][bower-url]
[](https://travis-ci.org/superRaytin/underscore.template)[](https://npmjs.org/package/underscore.template)
[npm-url]: https://npmjs.org/package/underscore.template
[downloads-image]: http://img.shields.io/npm/dm/underscore.template.svg
[npm-image]: http://img.shields.io/npm/v/underscore.template.svg
[bower-url]:http://badge.fury.io/bo/underscore.template
[bower-image]: https://badge.fury.io/bo/underscore.template.svg# Installation
### NPM
```
npm install underscore.template
```### Bower
```
bower install underscore.template
```# Usage
### Node.js
```js
var UnderscoreTemplate = require('underscore.template');
var template = UnderscoreTemplate("<%- value %>");template({value: 'hello world'});
// hello worldtemplate({value: ''});
// <b><script></b>
```### Browser
Simply download the latest minified version from the `dist/` folder. API is available in a global object called `UnderscoreTemplate`.
```html
<script src="./dist/underscore.template.js">
``````js
var template = UnderscoreTemplate("<%- value %>");template({value: 'hello world'});
// hello world
```# Testing
```
npm test
```# License
MIT, see the [LICENSE](/LICENSE) file for detail.