MCPcopy
hub / github.com/highlightjs/highlight.js / highlightFile

Function highlightFile

tools/perf.js:54–60  ·  view source on GitHub ↗
(lang)

Source from the content-addressed store, hash-verified

52};
53
54const highlightFile = (lang) => {
55 const source = fs.readFileSync(`./tools/sample_files/${lang}.txt`, { encoding: 'utf8' });
56 const hljs = require('../build.js');
57 for (let i = 0; i < 2000; i++) {
58 hljs.highlight(source, { language: lang });
59 }
60};
61
62const main = (lang) => {
63 build();

Callers 1

mainFunction · 0.85

Calls 1

highlightMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…