Gathering detailed insights and metrics for @kth/cortina-block
Gathering detailed insights and metrics for @kth/cortina-block
Gathering detailed insights and metrics for @kth/cortina-block
Gathering detailed insights and metrics for @kth/cortina-block
Node.js module for fetching Cortina blocks and optionally cache using Redis.
npm install @kth/cortina-block
Typescript
Module System
Min. Node Version
Node Version
NPM Version
TypeScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
1 Stars
268 Commits
20 Watchers
7 Branches
13 Contributors
Updated on Jul 10, 2025
Latest Version
7.1.0
Package Id
@kth/cortina-block@7.1.0
Unpacked Size
17.06 kB
Size
6.04 kB
File Count
15
NPM Version
10.8.2
Node Version
18.20.8
Published on
Jul 10, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
This package exposes an express middleware, that fetches som predefined blocks from Cortina CMS.
The blocks are then stored in res.locals.blocks
, for use in Handlebars or similar.
Blocks can optionaly be cached in Redis.
1npm install @kth/cortina-block
1import { cortinaMiddleware } from '@kth/cortina-block'
apply middleware
1server.use( 2 '', 3 cortinaMiddleware({ 4 blockApiUrl, 5 blocksConfig, 6 redisConfig, 7 }) 8)
Default blocks that will be fetched can be found in config.ts. If you want to fetch other blocks or override the id of the default blocks, provide the optional blocksConfig
.
blockApiUrl
is required. Should point to the Cortina block API endpoint.memoryCache
is optional. Defaults to "true" unless redisConfig
is provided. Stores blocks in memory for 10 minutes.redisConfig
is optional. An object parsed from kth-node-configuration
, containing host
and port
. If provided, blocks will be cached in redis.redisKey
is optional. Use unique keys of multiple apps share the same redis.supportedLanguages
is optional. If app only uses a subset of the supported languages. Default is ['sv', 'en']
.blocksConfig
is optional. It's a plain object containing Cortina block IDs. It can be used both to replace existing id's, and to add new blocks.
1const blocksConfig = { 2 footer: '1.123456', // Replaces existing block 3 studentMegaMenu: '1.1066510', // Adds a new block 4}
Blocks title, image and secondaryMenu are no longer used by the apps.
That also means that a bunch of config is no longer needed.
All fetched blocks will be avalible on res.locals.blocks
.
1{ 2 megaMenu: "\n\n\n\n <nav class=\"b…\n </nav>\n\n \n\n", 3 footer: "\n\n\n <div class=\"blo… </div>\n </div>\n\n\n", 4 search: "\n\n\n <div class=\"blo…aded=!0);</script>\n\n\n", 5 etc.. 6}
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
2 existing vulnerabilities detected
Details
Reason
Found 1/11 approved changesets -- score normalized to 0
Reason
1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More