Socket
Book a DemoInstallSign in
Socket

grunt-html2ts

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-html2ts

Create typescript string templates for html files.

0.0.4
latest
Source
npmnpm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

grunt-html2ts

Create typescript string templates for html files.

Getting Started

This plugin requires Grunt.

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-html2ts --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-html2ts');

The "html2ts" task

Overview

In your project's Gruntfile, add a section named html2ts to the data object passed into grunt.initConfig().

grunt.initConfig({
  html2ts: {
    options: {
      // Task-specific options go here.
    },
    your_target: {
      // Target-specific file lists and/or options go here.
    },
  },
})

Options

options.truncateNamespace

Type: String Default value: null

A string that is truncated from the start of the generated typescript module namespace.

options.truncateDir

Type: String Default value: null

A string that is truncated from the start of the generated output path when the htmlOutDir option is specified.

options.htmlOutDir

Type: String Default value: null

If specified the typescript will be generated starting in this directory.

options.flatten

Type: Boolean Default value: false

If true all the generated typescript will be in the output directory rather than in a copy of the original directory hierarchy.

Usage Examples

Default Options

In this example, all html files matching test/app/**/*.html will be transformed into typescript files with a copy of the original directory hierarchy into the test/.out directory.

grunt.initConfig({
   html2ts: {
      default: {
        options: {
          truncateNamespace: 'test',
          truncateDir: 'test/app',
          htmlOutDir: 'test/.out',
          flatten: false
        },
        files: {
          options: ['test/app/**/*.html']
        }
      }
    },
})

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

(Nothing yet)

License

Copyright (c) 2015 Bernd Wessels. Licensed under the MIT license.

Keywords

gruntplugin

FAQs

Package last updated on 24 May 2015

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.