plainJS

Libraries / UI

Code Prettify

An embeddable script that makes source-code snippets in HTML prettier.

Dormant0 dependenciesScript tagApache-2.0

Facts

Facts fetched 2026-10-30 by the directory sync (GitHub, npm, jsDelivr, deps.dev). Nothing here is typed by hand.
Size16.0 KB minified, 7.3 KB gzipped (src/prettify.js)
LicenceApache-2.0
Dependenciesnone
Last releasev0.1.0, January 2017
Last activity2020-04-21 (Dormant)
Stars5,748 on GitHub
Formatsclassic script (global DecorationsT;JobT;SourceSpansT;IN_GLOBAL_SCOPE;HACK_TO_FIX_JS_INCLUDE_PL;PR;prettyPrintOne;prettyPrint;PR_SHOULD_USE_CONTINUATION)
CDN hits144,814 a month on jsDelivr
npm downloads53,949 a month
GatesG1 passed (no runtime dependencies); G2 passed (loads in a browser as it is); G3 passed (no compile-only entry points); G4 passed (open-source licence); G5 failed (not archived or deprecated). Smoke test on v0.1.0 in headless Chromium, 2026-10-30

Load it

Pin the version. The hash is computed from the file jsDelivr serves, so a changed file fails to load instead of running.

htmlscript tag, with SRI
<script src="https://cdn.jsdelivr.net/npm/[email protected]/src/prettify.js"
        integrity="sha384-zU9URL3FT5CwJTvxMj/wt/JAECum3qRIBXKACIoS3PQa6FoWgecbfK1pvfJbLzI8" crossorigin="anonymous"></script>
Advertisement

Entry 19 in the directory. Facts refreshed monthly; last run 2026-10-30.