• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cameri / nostream / 24602829423

18 Apr 2026 10:35AM UTC coverage: 54.392% (+4.4%) from 49.987%
24602829423

push

github

web-flow
fix: serve real home page instead of redirecting, add templated pages (#409)

557 of 1123 branches covered (49.6%)

Branch coverage included in aggregate %.

53 of 58 new or added lines in 8 files covered. (91.38%)

1573 of 2793 relevant lines covered (56.32%)

9.48 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

46.67
/src/utils/template-cache.ts
1
import { readFileSync } from 'fs'
2✔
2

3
const cache = new Map<string, string>()
2✔
4
const isProd = process.env.NODE_ENV === 'production'
2✔
5

6
/**
7
 * Return the raw content of a template file.
8
 *
9
 * In production (NODE_ENV=production) the file is read from disk once and
10
 * cached for the lifetime of the process — no per-request I/O. Operators who
11
 * edit files under resources/ must restart the process for changes to take
12
 * effect.
13
 *
14
 * Outside of production the cache is bypassed so template edits are reflected
15
 * immediately without a restart.
16
 */
17
export const getTemplate = (path: string): string => {
2✔
18
  if (isProd) {
4!
NEW
19
    let template = cache.get(path)
×
NEW
20
    if (template === undefined) {
×
NEW
21
      template = readFileSync(path, 'utf8')
×
NEW
22
      cache.set(path, template)
×
23
    }
NEW
24
    return template
×
25
  }
26

27
  return readFileSync(path, 'utf8')
4✔
28
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc