
Research
Node.js Fixes AsyncLocalStorage Crash Bug That Could Take Down Production Servers
Node.js patched a crash bug where AsyncLocalStorage could cause stack overflows to bypass error handlers and terminate production servers.
pygments-tokens
Advanced tools
A map of the tokens used by the pygments syntax highlighter
Pygments is a syntax highlighter that supports over 300 programming languages. To use pygments in node, check out pygmentize-bundled or other options on npm.
Given this JavaScript string:
var a = "b";
pygments will generate this HTML:
<div class="highlight"><pre>
<span class="kd">var</span>
<span class="nx">a</span>
<span class="o">=</span>
<span class="s2">"b"</span>
<span class="p">;</span>
</pre></div>
See the kd, nx, o classes above? This package exports a map of all the tokens used by pygments.
Use it to generate and/or validate pygments CSS stylesheets, or to create a whitelist of allowable CSS class names.
Here's the whole exported object, for reference:
{
w: 'Whitespace',
esc: 'Escape',
err: 'Error',
x: 'Other',
k: 'Keyword',
kc: 'Keyword.Constant',
kd: 'Keyword.Declaration',
kn: 'Keyword.Namespace',
kp: 'Keyword.Pseudo',
kr: 'Keyword.Reserved',
kt: 'Keyword.Type',
n: 'Name',
na: 'Name.Attribute',
nb: 'Name.Builtin',
bp: 'Name.Builtin.Pseudo',
nc: 'Name.Class',
no: 'Name.Constant',
nd: 'Name.Decorator',
ni: 'Name.Entity',
ne: 'Name.Exception',
nf: 'Name.Function',
py: 'Name.Property',
nl: 'Name.Label',
nn: 'Name.Namespace',
nx: 'Name.Other',
nt: 'Name.Tag',
nv: 'Name.Variable',
vc: 'Name.Variable.Class',
vg: 'Name.Variable.Global',
vi: 'Name.Variable.Instance',
l: 'Literal',
ld: 'Literal.Date',
s: 'String',
sb: 'String.Backtick',
sc: 'String.Char',
sd: 'String.Doc',
s2: 'String.Double',
se: 'String.Escape',
sh: 'String.Heredoc',
si: 'String.Interpol',
sx: 'String.Other',
sr: 'String.Regex',
s1: 'String.Single',
ss: 'String.Symbol',
m: 'Number',
mb: 'Number.Bin',
mf: 'Number.Float',
mh: 'Number.Hex',
mi: 'Number.Integer',
il: 'Number.Integer.Long',
mo: 'Number.Oct',
o: 'Operator',
ow: 'Operator.Word',
p: 'Punctuation',
c: 'Comment',
cm: 'Comment.Multiline',
cp: 'Comment.Preproc',
c1: 'Comment.Single',
cs: 'Comment.Special',
g: 'Generic',
gd: 'Generic.Deleted',
ge: 'Generic.Emph',
gr: 'Generic.Error',
gh: 'Generic.Heading',
gi: 'Generic.Inserted',
go: 'Generic.Output',
gp: 'Generic.Prompt',
gs: 'Generic.Strong',
gu: 'Generic.Subheading',
gt: 'Generic.Traceback'
}
FAQs
A map of the tokens used by the pygments syntax highlighter
We found that pygments-tokens demonstrated a not healthy version release cadence and project activity because the last version was released 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.

Research
Node.js patched a crash bug where AsyncLocalStorage could cause stack overflows to bypass error handlers and terminate production servers.

Research
/Security News
A malicious Chrome extension steals newly created MEXC API keys, exfiltrates them to Telegram, and enables full account takeover with trading and withdrawal rights.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.