Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
io-ng2-aot-fixer-pug
Advanced tools
A small tool to generate typescript files from .pug template files. Useful for ng2 devlopment
This package tries to fix the ng2 AOT compiler behaviour that expect the template of a @Component
to be a string.
ngc works fine if the template
metadata is defined for a @Component but when you want to use .pug
files for your templates
it fails.
import { tpl } from "./this-component.pug";
@Component({
template: tpl
})
This would fail since typescript has no knowledge of how to handle pug files:
❯ node_modules/.bin/ngc -p .
TypeError: this._input.charCodeAt is not a function
at _Tokenizer._advance (/Users/me/dev/angular-2-seed/node_modules/@angular/compiler/bundles/compiler.umd.js:4980:73)
at new _Tokenizer (/Users/me/dev/angular-2-seed/node_modules/@angular/compiler/bundles/compiler.umd.js:4864:16)
This package generates a .ts
file for every pug file present that will contain the pure HTML as parsed by pug.
It must be run before doing a ngc
build.
The compiler will then be able to resolve the .pug
import as a string (The content is exposed as a export named tpl
!)
In the above example a file called ./this-component.pug.ts
will be generated.
You may safely add *.pug.ts
files to your .gitignore
since you'll only need them for the AOT compiler run.
node_modules/.bin/ng2-aot-fixer-pug --src-path src
FAQs
A small tool to generate typescript files from .pug template files. Useful for ng2 devlopment
The npm package io-ng2-aot-fixer-pug receives a total of 0 weekly downloads. As such, io-ng2-aot-fixer-pug popularity was classified as not popular.
We found that io-ng2-aot-fixer-pug 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
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.