
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
gulp-ng-template-strings
Advanced tools
Inline angular templates into directive definition objects
npm i --save-dev gulp-ng-template-strings
Pass the plugin js files containing templateUrl properties to have them
replaced with template properties.
gulpfile.js
var gulp = require('gulp');
var ngTemplateStrings = require('gulp-ng-template-strings');
gulp.task('default', function() {
return gulp.src('src/**/*.js')
.pipe(ngTemplateStrings())
.pipe(gulp.dest('dist'));
});
Input files
src/tab.js
function tabDirective() {
return {
templateUrl: 'templates/tab.html'
};
}
templates/tab.html
<ul>
<li>Tab</li>
</ul>
Output file
dist/tab.js
function tabDirective() {
return {
templateUrl: '<ul><li>Tab</li></ul>'
};
}
All options can be passed on stream creation.
ngTemplateStrings(options)
cwdBy default the plugin looks for files based of the file.cwd of each file
passed through. This option overrides that for all files passed to a stream.
ngTemplateStrings({cwd: 'root/of/templatesUrls/'})
minifyYour html strings will be minified with html-minifier. You can override our default configuration by passing a minify object in the settings object.
ngTemplateStrings({minify: {collapseWhitespace: false}})
By default we use the following options:
{
removeComments: true, // remove html comments
removeCommentsFromCDATA: true, // removes comments from inline JS & CSS
collapseWhitespace: true, // collapse whitespace in text nodes
caseSensitive: true // preserve case in attributes
// all other options use html-minifier's default, false.
}
You can also disable minification altogether by passing:
ngTemplateStrings({minify: false})
FAQs
inline angular templates into directive definition objects
We found that gulp-ng-template-strings demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.