🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

gulp-html2ts

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-html2ts

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

0.0.14
latest
Source
npm
Version published
Weekly downloads
10
-68.75%
Maintainers
1
Weekly downloads
 
Created
Source

gulp-html2ts

This plugin filter html to typescript.

Input

MyView.html

<div>
</div>

Output

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

Usage

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

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

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

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';
    }) )
)

Keywords

gulp

FAQs

Package last updated on 01 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts