Skip to main content

@thai/html@0.0.5
Built and signed on GitHub Actions

Safely generate HTML strings

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
4 months ago (0.0.5)
method Hypertext.from
Hypertext.from(html: any): Hypertext

Create a Hypertext object from a value.

If the value is a string, it is escaped. If the value is an array, it is recursively converted to HTML. If the value is an object with a __html property, it is used as is. If the value is null or undefined, it is converted to an empty string. Otherwise, it is converted to a string and escaped.

Parameters

html: any

Return Type

Add Package

deno add jsr:@thai/html

Import symbol

import { Hypertext } from "@thai/html";

---- OR ----

Import directly with a jsr specifier

import { Hypertext } from "jsr:@thai/html";

Add Package

npx jsr add @thai/html

Import symbol

import { Hypertext } from "@thai/html";

Add Package

yarn dlx jsr add @thai/html

Import symbol

import { Hypertext } from "@thai/html";

Add Package

pnpm dlx jsr add @thai/html

Import symbol

import { Hypertext } from "@thai/html";

Add Package

bunx jsr add @thai/html

Import symbol

import { Hypertext } from "@thai/html";