Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
gulp-html-compile
Advanced tools
A small gulp plugin to compile your static html into javascript templates
Compile static ( no logic ) HTML templates into javascript files
This plugin is heavily inspired by Emanuele Ingrosso's gulp plugin which was itself inspired by Sindre Sorhus's gulp-nunjucks plugin.
Install with npm
npm install gulp-html-compile --save-dev
<h1 class="my-header">Welcome to my awesome site!</h1>
var gulp = require( 'gulp' ),
template = require( 'gulp-html-compile' ),
concat = require( 'gulp-concat' ),
wrap = require( 'gulp-wrap' );
gulp.task( 'templates', function() {
gulp.src( './templates/**/*.html' )
.pipe( template({
name: function( file ) {
return file.relative.split( '.' )[ 0 ];
},
namespace: 'myTemplates'
}))
.pipe( concat( 'myTemplates.js' ))
.pipe( wrap( 'module.exports = window["myTemplates"]'))
.pipe( gulp.dest( './js/'));
});
Type: object
Type: string
Default: Relative template path
Example: templates/header.html
You can override the default behavior by supplying a function which gets the current File object and is expected to return the name.
{
name: function( file ) {
return file.relative.split( '.' )[ 0 ];
}
}
Type: 'string' Default: 'templates'
The namespace in which the precompiled templates will be assigned.
{
namespace: 'MyCoolTemplates'
}
FAQs
A small gulp plugin to compile your static html into javascript templates
The npm package gulp-html-compile receives a total of 0 weekly downloads. As such, gulp-html-compile popularity was classified as not popular.
We found that gulp-html-compile demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
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.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.