You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

svelte-highlight

Package Overview
Dependencies
Maintainers
1
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte-highlight

Syntax Highlighting for Svelte using highlight.js

0.1.1
Source
npmnpm
Version published
Weekly downloads
12K
15.2%
Maintainers
1
Weekly downloads
 
Created
Source

svelte-highlight

NPM Build Coverage

Syntax Highlighting for Svelte using highlight.js.

This component wraps highlight.js to provide syntax highlighting in Svelte 3.

Install

yarn add svelte-highlight

Usage

<script>
  import Highlight from 'svelte-highlight';
  import { typescript } from 'svelte-highlight/languages';
  import 'svelte-highlight/styles/github.css';
</script>

<Highlight language={typescript}>const a: number = 4;</Highlight>

Note: Importing a css file in Svelte requires the appropriate module loader. Refer to the rollup example.

Changelog

License

MIT

Keywords

svelte

FAQs

Package last updated on 09 Nov 2019

Did you know?

Socket

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.

Install

Related posts