
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@expressive-code/core
Advanced tools
A text marking & annotation engine for presenting source code on the web.
The core package of Expressive Code, an engine for presenting source code on the web.
Read the Expressive Code docs to learn more about the features provided by Expressive Code.
Using this core package directly is only recommended for advanced use cases.
Unless you're a plugin or integration author, you should probably use a higher-level package like astro-expressive-code
or rehype-expressive-code
instead of this one.
npm install @expressive-code/core
import { ExpressiveCodeEngine } from '@expressive-code/core'
import { toHtml } from '@expressive-code/core/hast'
const ec = new ExpressiveCodeEngine({
plugins: [
// Add your plugins here
],
})
const baseStyles = await ec.getBaseStyles()
const themeStyles = await ec.getThemeStyles()
const renderResult = await ec.render({
code: 'console.log("Hello world!")',
language: 'js',
})
// Output results to the console
console.dir({
baseStyles,
themeStyles,
blockStyles: renderResult.styles,
blockHtml: toHtml(renderResult.renderedGroupAst),
})
FAQs
A text marking & annotation engine for presenting source code on the web.
The npm package @expressive-code/core receives a total of 45,928 weekly downloads. As such, @expressive-code/core popularity was classified as popular.
We found that @expressive-code/core 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.