Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

broccoli-html2js

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

broccoli-html2js

Converts AngularJS templates to JavaScript

  • 0.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

broccoli-html2js

Converts AngularJS templates to JavaScript

Installation

nmp install broccoli-html2js 

Options

inputFiles

Type: Array
Default: []

Source files (supports html, jade)

outputFile

Type: String
Default: '' Output file (supports js, coffee)

replace

Type: Function
Default: undefined

Function that will apply for each filepath

replace: function (filepath) {
  return filepath.replace(/\.jade/g, '.html');
}
replaceContent

Type: Function
Default: undefined

Function that will apply for each file

replaceContent: function (content) {
  return content.replace(/div/g, 'span');
}
module

Type: String
Default: ''

Parent module name

singleModule

Type: Boolean
Default: false

Wraps all templates in a single module.

fileHeaderString

Type: String
Default: undefined

String that will set in the top of output file.

fileFooterString

Type: String
Default: undefined

String that will set in the end of output file.

useStrict

Type: Boolean
Default: false

Will set 'use strict' for each module.

htmlmin

Type: Object
Default: {}

See more options on https://github.com/kangax/html-minifier

Example

templates = html2js(tree, {
  inputFiles: ['*.html', '*.jade'],
  outputFile: '/templates.js'      // or templates.coffee
});

Release History

0.0.5 - Added options fileHeaderString, fileFooterString, useStrict, replaceContent

0.0.4 - Updated Readme

0.0.3 - Add support for CoffeeScript, Jade, option singleModule (for placing all templates in a single module).

0.0.2 - Small changes

0.0.1 - Init project

Keywords

FAQs

Package last updated on 12 Jul 2014

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

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc