# gulp-cmd-jst

> compile templates to a jst file for 'CMD' and 'AMD'.U can set output type html

Latest version **0.1.6** (published 2015-12-21) · ISC license · 0 weekly downloads

## Install

```sh
npm install gulp-cmd-jst
pnpm add gulp-cmd-jst
yarn add gulp-cmd-jst
bun add gulp-cmd-jst
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.6 |
| Published | 2015-12-21 |
| First published | 2015-09-10 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+4 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | brucecham |
| Maintainers | brucecham |
| Keywords | gulpplugin, jst-cmd, jst-amd, template, lodash, jst |

## Links

- npm: https://www.npmjs.com/package/gulp-cmd-jst
- Repository: https://github.com/brucecham/gulp-cmd-jst
- Issues: https://github.com/brucecham/gulp-cmd-jst/issues
- npm.io page: https://npm.io/package/gulp-cmd-jst

## Dependencies (3)

- [lodash](https://npm.io/package/lodash.md) ~2.4.1
- [through2](https://npm.io/package/through2.md) ~0.4.1
- [gulp-util](https://npm.io/package/gulp-util.md) ~2.2.12

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 0.1.6 (latest) — 2015-12-21
- 0.1.5 — 2015-12-18
- 0.1.4 — 2015-12-18
- 0.1.3 — 2015-12-18
- 0.1.2 — 2015-09-18
- 0.1.1 — 2015-09-15
- 0.1.0 — 2015-09-10

## README

gulp-cmd-jst [![Build Status](https://travis-ci.org/brucecham/gulp-cmd-jst.svg?branch=master)](https://travis-ci.org/brucecham/gulp-cmd-jst)
========

Compile [lodash templates](http://lodash.com/docs#template) to a JST file using [gulp](https://github.com/wearefractal/gulp).

Install
-------

Install using [npm](https://npmjs.org/package/gulp-cmd-jst).

```
npm install gulp-cmd-jst --save-dev
```

Usage
-----

```js
var gulp = require('gulp');
var jst = require('gulp-cmd-jst');

gulp.task('jst', function() {
    gulp.src('input/*.html')
        .pipe(jst(
            {
                templateSettings: {
                  evaluate: /##([\s\S]+?)##/g,
                  interpolate: /\{\{(.+?)\}\}/g,
                  escape: /\{\{\{\{-([\s\S]+?)\}\}\}\}/g
                },
                //filter escape character
                processContent: function(src) {
                  return src.replace(/(^\s+|\s+$)/gm, '');
                },
                //compress Jst
                prettify: true, 
                //cmd: true || amd: true        
                cmd: true
            }
        ))
        .pipe(gulp.dest('./output'));
});

gulp.task('default', ['jst']);
```

###Note: 版本 version
* `0.1.5`: the code will remove escape character from lodash when setting 'prettify: true'
* `0.1.5`: 当设置 prettify: true时，jst代码压缩为一行，并去掉lodash转义过来的字符
* `0.1.6`: change settings options

### jst(options)

`gulp-cmd-jst` accepts the [same _.template options](http://lodash.com/docs#template) as the lodash library.

---
_Source: https://npm.io/package/gulp-cmd-jst · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
