New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

x-postpress-code

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

x-postpress-code - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

package.json
{
"name": "x-postpress-code",
"version": "1.0.0",
"version": "1.0.1",
"description": "A web component used for code highlighting.",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/kherrick/x-postpress-code",

@@ -5,15 +5,7 @@ # x-postpress-code

## Usage
Use the type attribute and include the source in the default slot with `pre` tags to render static content:
## Example usages
Pass a source url:
```html
<x-postpress-code type="js" src="https://example.com/example.js"></x-postpress-code>
```
Include the source in the default slot (inside `pre` tags):
```html
<x-postpress-code type="bash"><pre>

@@ -26,1 +18,47 @@ #/usr/bin/env bash

```
Lazy load the code to be highlighted by using both the type and src attributes:
```html
<x-postpress-code
src="https://example.com/example.js"
type="js"
></x-postpress-code>
```
## Installation
### from unpkg:
```html
<script
src="https://unpkg.com/x-postpress-code"
type="module"
></script>
```
### from npm:
```bash
npm i x-postpress-code
```
```js
import 'x-postpress-code'
```
## Using the following highlight.js languages:
* `bash`
* `c`
* `cpp`
* `css`
* `javascript`
* `json`
* `markdown`
* `php`
* `plaintext`
* `python`
* `shell`
* `typescript`
* `xml`
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc