Socket
Socket
Sign inDemoInstall

gulp-html2ts

Package Overview
Dependencies
23
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    gulp-html2ts

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


Version published
Weekly downloads
11
increased by120%
Maintainers
1
Install size
317 kB
Created
Weekly downloads
 

Readme

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

FAQs

Last updated on 01 Sep 2018

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc