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.
@w3soto/ngx-lazy-translate-loader
Advanced tools
Lazy module translation loader
npm -i @w3soto/ngx-lazy-translate-loader
function TranslateLoaderFactory(http: HttpClient): TranslateLoader {
return new NgxLazyTranslateHttpLoader(http, {
basePath: './assets/i18n', // default
suffix: '.json', // default,
modulePathKey: 'i18nPath', // default
// eager translation paths
paths: [
'static/module-1', // relative to "basePath"
'./assets/i18n/static/module-2' // absolute (starts with / or ./)
]
});
}
@NgModule({
...
imports: [
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: TranslateLoaderFactory,
deps: [HttpClient]
}
})
],
...
})
export class AppModule { }
Note: This solution guarantees that translation file will be loaded before module is loaded
const routes: Routes = [
{
path: 'lazy-module',
resolve: {
i18n: NgxLazyTranslateResolver
},
data: {
i18nPath: 'lazy/module' // relative path
},
loadChildren: () => import('./lazy-module/lazy-module.module').then(m => m.LazyModuleModule)
},
];
@NgModule({
imports: [
TranslateModule,
]
})
export class LazyModule {
constructor(i18n: NgxLazyTranslateServiceWrapper) {
i18n.registerModuleTranslation('./assets/i18n/lazy/module', true);
}
}
FAQs
Lazy module translation loader
The npm package @w3soto/ngx-lazy-translate-loader receives a total of 0 weekly downloads. As such, @w3soto/ngx-lazy-translate-loader popularity was classified as not popular.
We found that @w3soto/ngx-lazy-translate-loader 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.