Gathering detailed insights and metrics for @ng-web-apis/universal
Gathering detailed insights and metrics for @ng-web-apis/universal
A set of common utils for consuming Web APIs with Angular
npm install @ng-web-apis/universal
Typescript
Module System
Node Version
NPM Version
77.7
Supply Chain
83.7
Quality
89
Maintenance
100
Vulnerability
98.9
License
TypeScript (84.04%)
HTML (8.8%)
JavaScript (4.38%)
Less (2.12%)
CSS (0.63%)
Shell (0.03%)
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Total Downloads
450,736
Last Day
722
Last Week
3,792
Last Month
15,707
Last Year
163,502
Apache-2.0 License
769 Stars
1,197 Commits
40 Forks
12 Watchers
4 Branches
19 Contributors
Updated on Feb 28, 2025
Minified
Minified + Gzipped
Latest Version
4.11.1
Package Id
@ng-web-apis/universal@4.11.1
Unpacked Size
148.07 kB
Size
39.57 kB
File Count
57
NPM Version
10.8.2
Node Version
20.17.0
Published on
Oct 14, 2024
Cumulative downloads
Total Downloads
Last Day
-9.6%
722
Compared to previous day
Last Week
-3.1%
3,792
Compared to previous week
Last Month
27.3%
15,707
Compared to previous month
Last Year
-1.5%
163,502
Compared to previous year
1
4
A set of fallbacks to seamlessly use @ng-web-apis/common in Angular Universal apps. These packages have synced versions down to minor.
Add constants imported from this package to providers of your ServerAppModule
. Typically, you can also use these mocks
for tests. Idea of this package is — you shouldn't have to mock DOM on the server side or test isPlatformBrowser
all
the time. Instead, you leverage Angular DI system to abstract from implementation. When possible, this package will
provide the same functionality on the server side as you have in browser. In other cases you will get type-safe mocks
and you can at least be sure you will not have cannot read property of null
or undefined is not a function
errors in
SSR.
You can import UNIVERSAL_PROVIDERS
in the following manner:
1const serverConfig: ApplicationConfig = { 2 providers: [ 3 provideServerRendering(), 4 UNIVERSAL_PROVIDERS, // <-- add this 5 ], 6}; 7 8const config = mergeApplicationConfig(appConfig, serverConfig); 9const bootstrap = () => bootstrapApplication(AppComponent, config);
When you use plain SSR without prerender you can retrieve some of the information from requests. Use the following helpers to harvest that info:
server.ts:
1import {provideLocation, provideUserAgent} from '@ng-web-apis/universal'; 2 3// ... 4 5app.get('/**/*', (req: Request, res: Response) => { 6 res.render('../dist/index', { 7 req, 8 res, 9 providers: [provideLocation(req), provideUserAgent(req)], 10 }); 11});
No vulnerabilities found.
No security vulnerabilities found.