# gulp-html2ts

> gulp-html2ts === This plugin filter html to typescript.

Latest version **0.0.14** (published 2018-09-01) · MIT license · 0 weekly downloads

## Install

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

## 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.0.14 |
| Published | 2018-09-01 |
| First published | 2018-08-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Kazuhiko Arase |
| Maintainers | kazuhikoarase |
| Keywords | gulp, html, typescript |

## Links

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

## Dependencies (3)

- [path](https://npm.io/package/path.md) ^0.12.7
- [through2](https://npm.io/package/through2.md) ^2.0.3
- [plugin-error](https://npm.io/package/plugin-error.md) ^1.0.1

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 0.0.14 (latest) — 2018-09-01
- 0.0.12 — 2018-09-01
- 0.0.11 — 2018-09-01
- 0.0.10 — 2018-09-01
- 0.0.9 — 2018-09-01
- 0.0.8 — 2018-09-01
- 0.0.7 — 2018-09-01
- 0.0.5 — 2018-09-01
- 0.0.4 — 2018-08-31
- 0.0.3 — 2018-08-31
- 0.0.2 — 2018-08-31
- 0.0.1 — 2018-08-25

## README

gulp-html2ts
===
This plugin filter html to typescript.

### Input

MyView.html

```html
<div>
</div>
```

### Output

```typescript
namespace a.b.c { export var MyView = `<div></div>`; }
```

## Usage

With merge-stream and gulp-rename plugin, append htmls to typescript source set.

```javascript
gulp.src('src/main/ts/**/*.ts')
```

In this case, FooBar.html filtered to _FooBar.html.ts

```javascript
const mergeStream = require('merge-stream');
const rename = require('gulp-rename');
const html2ts = require('gulp-html2ts');

  ...

mergeStream(
  gulp.src('src/main/ts/**/*.ts'),
  gulp.src('src/main/ts/**/*.html')
    .pipe(html2ts() )
    .pipe(rename(function(path) {
      path.basename = '_' + path.basename;
      path.extname += '.ts';
    }) )
)
```

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