Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
@speed-highlight/core
Advanced tools
🌈 Light, fast, and easy to use, dependencies free javascript syntax highlighter, with automatic language detection
Light, fast, and easy to use, dependencies free javascript syntax highlighter, with automatic language detection, try it out here
Blazing fast highlighting using regex
Style/theme (in the header of your html file):
<link rel="stylesheet" href="/path/dist/themes/default.css">
In the body of your html file:
<div class='shj-lang-[code-language]'>[code]</div>
or
<code class='shj-lang-[code-language]'>[inline code]</code>
Highlight the code (in your javascript):
import { highlightAll } from '/path/dist/index.js'
highlightAll();
Auto language detection
import { highlightElement } from '../src/index.js';
import { detectLanguage } from '../src/detect.js';
elm.textContent = code;
highlightElement(elm, detectLanguage(code));
<link rel="stylesheet" href="https://unpkg.com/@speed-highlight/core/dist/themes/default.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/speed-highlight/core/dist/themes/default.css">
import ... from 'https://unpkg.com/@speed-highlight/core/dist/index.js'
import ... from 'https://cdn.jsdelivr.net/gh/speed-highlight/core/dist/index.js'
Use the deno module
import { setTheme, printHighlight } from 'https://x.nest.land/speed_highlight_js/dist/term.js';
await setTheme('default');
printHighlight('console.log("hello")', 'js');
Use the npm package
npm i @speed-highlight/core
const { setTheme, printHighlight } = require('@speed-highlight/core/dist/node/term.js');
setTheme('default')
printHighlight('console.log("hello")', 'js');
Name | Class name | Support | Language detection |
---|---|---|---|
bash | shj-lang-bash | ✅ | |
brainfuck | shj-lang-bf | increment, operator, print, comment | ❌ |
css | shj-lang-css | comment, str, selector, units, function, ... | ✅ |
csv | shj-lang-csv | punctuation, ... | ❌ |
diff | shj-lang-diff | ✅ | |
git | shj-lang-git | comment, insert, deleted, string, ... | ❌ |
html | shj-lang-html | ✅ | |
http | shj-lang-http | keywork, string, punctuation, variable, version | ✅ |
ini | shj-lang-ini | ❌ | |
javascipt | shj-lang-js | basic syntax, regex, jsdoc, json, template literals | ✅ |
jsdoc | shj-lang-jsdoc | ❌ | |
json | shj-lang-json | string, number, bool, ... | ❌ |
leanpub-md | shj-lang-leanpub-md | ❌ | |
log | shj-lang-log | number, string, comment, errors | ❌ |
lua | shj-lang-lua | ✅ | |
makefile | shj-lang-make | ✅ | |
markdown | shj-lang-md | ✅ | |
perl | shj-lang-pl | ✅ | |
plain | shj-lang-plain | ❌ | |
python | shj-lang-py | ✅ | |
regex | shj-lang-regex | count, set, ... | ❌ |
sql | shj-lang-sql | number, string, function, ... | ✅ |
todo | shj-lang-todo | ❌ | |
toml | shj-lang-toml | comment, table, string, bool, variable | ❌ |
typescript | shj-lang-ts | js syntax, ts keyword, types | ✅ |
uri | shj-lang-uri | ✅ | |
yaml | shj-lang-yaml | comment, numbers, variable, string, bool | ❌ |
docker | shj-lang-docker | ✅ | |
c | shj-lang-c | ✅ | |
xml | shj-lang-xml | ✅ | |
rust | shj-lang-rs | ✅ | |
go | shj-lang-go | ✅ | |
java | shj-lang-java | ✅ | |
asm | shj-lang-asm | ✅ |
A modern theme by default
Name | Terminal | Web |
---|---|---|
default | ✅ | ✅ |
github-dark | ❌ | ✅ |
github-light | ❌ | ✅ |
github-dim | ❌ | ✅ |
atom-dark | ❌ | ✅ |
visual-studio-dark | ❌ | ✅ |
Further in-depth documentation for the API and other topics is in our Wiki
Shj is released under the Creative Commons Zero License. See our LICENSE file for details.
FAQs
🌈 Light, fast, and easy to use, dependencies free javascript syntax highlighter, with automatic language detection
The npm package @speed-highlight/core receives a total of 3,931 weekly downloads. As such, @speed-highlight/core popularity was classified as popular.
We found that @speed-highlight/core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.