New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gulp-ng-html2js

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-ng-html2js - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

2

package.json
{
"name": "gulp-ng-html2js",
"version": "0.1.0",
"version": "0.1.1",
"description": "A Gulp plugin which generates Javascript code which loads the HTML files of your AngularJS app into the $templateCache.",

@@ -5,0 +5,0 @@ "keywords": [

# gulp-ng-html2js [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][depstat-image]][depstat-url]
> ng-html2js plugin for [gulp](https://github.com/wearefractal/gulp)
> A plugin for [gulp](https://github.com/wearefractal/gulp) which generates AngularJS modules, which pre-load your HTML
code into the [$templateCache](http://docs.angularjs.org/api/ng.$templateCache). This way AngularJS doens't need to
request the actual HTML files anymore.

@@ -26,2 +28,25 @@ ## Usage

The main reason to use this module would be optimization. By pre-loading the HTML files, you can spare requests and
loading time when the files are actually needed. When you are optimizing, you should do it properly. So, we should add
the following plugins: `gulp-minify-html`, `gulp-uglify`, and `gulp-concat`:
```javascript
var ngHtml2Js = require("gulp-ng-html2js");
var minifyHtml = require("gulp-minify-html");
var concat = require("gulp-concat");
var uglify = require("gulp-uglify");
gulp.src("./partials/*.html")
.pipe(minifyHtml())
.pipe(ngHtml2Js({
moduleName: "MyAwesomePartials",
prefix: "/partials"
}))
.pipe(concat("partials.min.js"))
.pipe(uglify())
.pipe(gulp.dest("./dist/partials"));
```
This way you end up with 1 single, minified Javascript file, which pre-loads all the (minified) HTML templates.
## API

@@ -28,0 +53,0 @@

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