Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Very lightweight but strong global syntax highlighting library.
Very lightweight (2kb) but strong global syntax highlighting library.
$ npm install glowkit
# or
$ pnpm add glowkit
# or
$ yarn add glowkit
import glowkit from "glowkit";
const myCode = `
import React from 'react';
const App = () => {
return (
<div>Hello, world!</div>
)
}
export default App;
`;
const htmlResult = glowkit(myCode /* true */);
glowkit
Highlight code using Glowkit syntax highlighting.
export default function glowkit(str: string, noCss = false): string;
str
The code to highlight
noCss
Option for adding auto-css in the head.
default: false
:root {
--glowkit-bg-color: #282c34;
--glowkit-color: #fff;
--glowkit-border-radius: 4px;
--glowkit-padding: 8px;
--glowkit-font-size: 1.125rem;
--glowkit-line-height: 1.75rem;
--glowkit-font: monospace;
--glowkit-keyword: #c678dd;
--glowkit-operator: #b46fca;
--glowkit-object-element: #f3727c;
--glowkit-string: #56b6c2;
--glowkit-object-last-element: #e5c07b;
}
.glowkit {
background-color: var(--glowkit-bg-color);
color: var(--glowkit-color);
border-radius: var(--glowkit-border-radius);
padding: var(--glowkit-padding);
font-size: var(--glowkit-font-size);
line-height: var(--glowkit-line-height);
font-family: var(--glowkit-font);
display: flex;
flex-direction: column;
}
.glowkit > code * {
font-weight: normal;
color: #f1c97f;
}
.glowkit > code > strong.keyword {
color: var(--glowkit-keyword);
}
.glowkit > code > i.operator {
color: var(--glowkit-operator) !important;
}
.glowkit > code > .object_element {
color: var(--glowkit-object-element);
}
.glowkit > code > .string {
color: var(--glowkit-string);
}
.glowkit > code > .object_last_element {
color: var(--glowkit-object-last-element);
}
The MIT License (MIT)
FAQs
Very lightweight but strong global syntax highlighting library.
The npm package glowkit receives a total of 0 weekly downloads. As such, glowkit popularity was classified as not popular.
We found that glowkit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.