Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@jill64/svelte-html

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jill64/svelte-html

🏷️ Declarative attribute binding for the root html element

  • 0.2.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.7K
decreased by-68.19%
Maintainers
1
Weekly downloads
 
Created
Source

svelte-html

npm-version npm-license npm-download-month npm-min-size ci.yml codecov-coverage

🏷️ Declarative attribute binding for the root html element

Install

npm i @jill64/svelte-html

Usage

By passing a key-value set to the <SvelteHTML /> component, attributes are bind to the root html element.

<script>
  import { SvelteHTML } from '@jill64/svelte-html'
</script>

<SvelteHTML lang="en" prefix="example" />

<html lang="en" prefix="example">
  <!-- ... -->
</html>

SSR

Attribute binding with <SvelteHTML> is only applied on the client. To assign arbitrary attributes during SSR, use the transform function in the handle hook.

// hooks.server.js
import { transform } from '@jill64/svelte-html'

export const handle = async ({ event, resolve }) => {
  // ...
  return resolve(event, {
    transformPageChunk: transform({
      lang: 'en',
      prefix: 'example'
    })
  })
}

Keywords

FAQs

Package last updated on 05 Nov 2023

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

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