
Research
SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.
fly-ng-templatecache
Advanced tools
Concatenate and register Angular JS templates in the $templateCache, with Fly.
npm install -D fly-ng-templatecache
export default function* () {
yield this.source('templates/**/*.html')
.ngTemplates({
standalone: true,
file: 'app-views.html',
moduleName: 'app.templates',
// ...
})
.target('dist/js');
}
Type:
boolean
Default: false
If true, creates a new Angular JS module. If false, it is assumed that you are using an existing module.
Type:
string
Default: templates.js
The name of the file that will be place in your target() destination. Do not include a directory structure here.
Type:
string
Default: templates
The name of your Angular JS module or submodule.
.ngTemplates({
moduleName: 'app.templates'
})
Type:
string
Default: null
The module system that your templates-module should be prepared for. Currently supports:
iffe -- (immediately-invoked function expression)requirejs -- Require JSbrowserify -- Browserifyes6 -- ES6 / ES2015 module import/export.ngTemplates({
moduleSystem: 'browserify'
})
Type:
string
Default: angular.module("<%= module %>"<%= standalone %>).run(["$templateCache", function($templateCache) {
This precedes your template content and will correctly initialize your Angular module. It is not recommended you change this, but if you do, you retain the <%= module %> variable.
If the standalone option is true, an empty dependency array ([]) will replace <%= standalone %>.
Type:
string
Default: $templateCache.put("<%= url %>","<%= contents %>");
The template wrapper for each view's content. It is not recommended to change this.
Type:
string
Default: }]);
This is appended to your module file. There probably is no reason to change this.
Type:
function
Default: (url) => url
The function that handles or alters your views' reference URLs.
By default:
yield this
.source('app/scripts/templates/*.html')
.ngTemplates(/* defaults */)
.target('dist/js')
All template files will be retain their full path, so you must use the full path.
<div ng-include="'app/scripts/templates/app.html'"></div>
To change this, pass in a custom transformUrl function:
yield this
.source('app/scripts/templates/*.html')
.ngTemplates({
transformUrl: (url) => {
return url.replace('app/scripts/templates/', '') // remove that path
}
}
})
.target('dist/js')
With app/scripts/templates/ removed, the reference ID is now just app.html.
<div ng-include="'app.html'"></div>
MIT © Luke Edwards et al
FAQs
Concatenate and register Angular JS templates in the $templateCache.
The npm package fly-ng-templatecache receives a total of 11 weekly downloads. As such, fly-ng-templatecache popularity was classified as not popular.
We found that fly-ng-templatecache 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.

Research
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.