# gulp-dot2module

> Pre-compile doT templates to commonJS modules.Support multiple sub-tpl.

Latest version **1.0.2** (published 2016-10-10) · ISC license · 0 weekly downloads

## Install

```sh
npm install gulp-dot2module
pnpm add gulp-dot2module
yarn add gulp-dot2module
bun add gulp-dot2module
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2016-10-10 |
| First published | 2016-10-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Homkai |
| Maintainers | homkai |
| Keywords | gulpplugin, gulp, dot, template, module, seajs, requirejs, multiple |

## Links

- npm: https://www.npmjs.com/package/gulp-dot2module
- Repository: https://github.com/homkai/gulp-dot2module
- Homepage: https://github.com/homkai/gulp-dot2module#readme
- Issues: https://github.com/homkai/gulp-dot2module/issues
- npm.io page: https://npm.io/package/gulp-dot2module

## Dependencies (3)

- [dot](https://npm.io/package/dot.md) ^1.0.3
- [through2](https://npm.io/package/through2.md) ^2.0.1
- [gulp-util](https://npm.io/package/gulp-util.md) ^3.0.7

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2016-10-10
- 0.2016.1-0.7 — 2016-10-07

## README

# gulp-dot2module
Gulp plugin for pre-compile doT templates to commonJS modules.Support multiple sub-tpl.
## Example
If we have following folder structure:
src/tpl-multiple.html:
```html
<script type="text/template" export="main">
  <div>{{=it.title}}</div>
</script>
<script type="text/template" export="detail">
  <div>{{=it.title}}</div>
</script>
```
src/tpl-single.html:
```html
<div>{{=it.title}}</div>
```
Then, running this code:
```js
var dot2module = require('gulp-dot2module');
gulp.task('templates', function() {
    gulp.src('src/*.html')
    .pipe(dot2module())
    .pipe(gulp.dest('dist'));
});
```
Will produce:
dist/tpl-multiple.js:
```js
define('tpl-multiple', function(require, exports, module){
    exports.main = function ...
    exports.detail = function ...
    ...
});
```
dist/tpl-single.js:
```js
define('tpl-single', function(require, exports, module){
    module.exports = function ...
});
```

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