@presta/html
TypeScript icon, indicating that this package has built-in type declarations

0.2.5 • Public • Published

@presta/html

Util for generating HTML pages.

Usage

Have a look at the source code and tests for all supported properties.

import { html } from '@presta/html'

export const route = '*'

export async function handler(ev, ctx) {
  return html({
    head: {
      title: 'Presta',
      image: '/social.png',
      description: 'SEO Description.',
      og: {
        url: 'https://presta.run',
      },
      twitter: {
        site: '@presta_run',
      },
      link: [{ rel: 'stylesheet', href: '/style.css' }],
      meta: [{ name: 'viewport', content: '' }],
      script: [{ src: '/critical.js' }],
    },
    body: '<h1>Hello world!</h1>',
    foot: {
      script: [{ src: '/critical.js' }],
    },
  })
}

License

MIT License © Sure Thing

Readme

Keywords

none

Package Sidebar

Install

npm i @presta/html

Weekly Downloads

496

Version

0.2.5

License

MIT

Unpacked Size

20.4 kB

Total Files

5

Last publish

Collaborators

  • estrattonbailey
  • nickbytes