luciascript
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

luciascript

Hastscript-like utility to create HTML strings

Build Status Coverage Status NPM version Minzipped size

Installation

$ npm install luciascript
# Or with yarn
$ yarn add luciascript

Luciascript exports UMD, CJS, and ES builds.

// ES
import { l } from "luciascript";
// CJS
const { l } = require("luciascript");
// UMD
const { l } = window.Luciascript;

Usage

Luciascript has the following type declarations:

declare l(tag: string, props: Record<string, string> = {}, children: string[] | string[] = []) => string;

Given those properties it will generate HTML.

l("div", { className: "foo", id: "bar", style: "text-align: center;" }, [
    l("p", {}, "Hello World!"),
    l("button", {}, "Click Me!")
])
<div class="foo" id="bar" style="text-align: center;">
    <p>Hello World</p>
    <button>Click Me!</button>
</div>

/luciascript/

    Package Sidebar

    Install

    npm i luciascript

    Weekly Downloads

    2

    Version

    0.1.1

    License

    MIT

    Unpacked Size

    7.49 kB

    Total Files

    13

    Last publish

    Collaborators

    • shadowtime2000