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.
@nguniversal/common
Advanced tools
This is the common Angular Universal module that is common across server-side rendering app irrespective of the rendering engine.
The package can be installed using:
npm install @nguniversal/common --save
TransferHttpCacheModule
installs a Http interceptor that avoids duplicate HttpClient
requests
on the client, for requests that were already made when the application was rendered on the server
side.
When the module is installed in the application NgModule
, it will intercept HttpClient
requests
on the server and store the response in the TransferState
key-value store. This is transferred to the client, which then uses it to respond to the same HttpClient
requests on the client.
To use the TransferHttpCacheModule
, first install it as part of the top-level App module.
import {TransferHttpCacheModule} from '@nguniversal/common';
@NgModule({
imports: [
BrowserModule.withServerTransition({appId: 'my-app'}),
TransferHttpCacheModule,
],
bootstrap: [MyApp]
})
export class AppBrowserModule() {}
Then, import ServerTransferStateModule
in your Server module.
import { NgModule } from "@angular/core";
import {
ServerModule,
ServerTransferStateModule
} from "@angular/platform-server";
import { AppModule } from "./app.module";
import { AppComponent } from "./app.component";
@NgModule({
imports: [
AppModule,
ServerModule,
ServerTransferStateModule
],
bootstrap: [AppComponent]
})
export class AppServerModule {}
Finally, in main.ts
change this:
...
platformBrowserDynamic().bootstrapModule(AppBrowserModule);
To this:
...
document.addEventListener("DOMContentLoaded", () => {
platformBrowserDynamic()
.bootstrapModule(AppBrowserModule)
.catch(err => console.log(err));
});
FAQs
Angular Universal common utilities
The npm package @nguniversal/common receives a total of 61,189 weekly downloads. As such, @nguniversal/common popularity was classified as popular.
We found that @nguniversal/common 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.
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.