npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@skylivellc/lienzo-core

v0.2.0

Published

Document schema and renderer for Lienzo landing pages. No framework required.

Readme

@skylivellc/lienzo-core

The document format and renderer of Lienzo, an open-source landing page builder. It parses page documents, renders them to static HTML, and defines the HTTP protocol the Lienzo editor speaks. It has no framework dependency and runs in Node and in the browser.

Use this package to host Lienzo on a backend other than Laravel. Laravel apps use the Composer package skylive/lienzo, which ships a PHP renderer that produces the same bytes.

npm install @skylivellc/lienzo-core

Validate a document

parseDocument is the only way to get a Parsed<Document>. It throws a DocumentError whose issues carry dotted paths, such as sections.0.elements.3.style.color:

import { DocumentError, parseDocument, type Catalog, type Document } from '@skylivellc/lienzo-core';

const catalog: Catalog = { elements: [], actions: [] };

/** The draft to store, or the 422 answer the editor shows next to each problem. */
function readDraft(input: unknown): Document | Response {
	try {
		return parseDocument(input, catalog);
	} catch (error) {
		if (error instanceof DocumentError) {
			return Response.json({ message: 'The page is not valid.', issues: error.issues }, { status: 422 });
		}
		throw error;
	}
}

The catalog lists the elements, actions and site fields your app registers. parseSiteSettings, parseTheme, parseSeo and parseFields validate the other values the editor sends.

Render a published page

renderPage returns the complete HTML document, with lienzo.css and the page script inlined. The host answers what the renderer cannot know: image URLs, app action links, app element markup and form state.

import { parseDocument, parseSiteSettings, renderPage, trustedHtml } from '@skylivellc/lienzo-core';

const page = await renderPage({
	document: parseDocument(stored.published, catalog),
	catalog,
	site: parseSiteSettings(stored.site),
	page: { slug: 'pricing', seo: stored.seo, url: 'https://example.com/pricing' },
	base: '',
	mode: 'public',
	host: {
		media: (ref) => lookUpImage(ref), // `media:<id>` to { url, thumb, width, height }, or null
		action: (action) => null, // an href for your app's action types
		appElement: (element) => trustedHtml(renderMyElement(element)),
		form: { action: '/submit', csrf: null, old: () => null, error: () => null, notice: null },
	},
});

return new Response(page.html, { headers: { 'Content-Type': 'text/html; charset=utf-8' } });

appElement output, head and app element CSS are the only HTML the renderer does not escape. Escape your data in them.

Accept form submissions

Published forms post source, slug, and fields[<name>] values. Look up the form with formFields(publishedDocument) by its source, and validate the posted values against that field list, not against what the browser sent.

Implement the editor protocol

@skylivellc/lienzo-core/protocol exports the Protocol type: every route the editor calls, keyed by method and path, with its request and response bodies. Workspace, PageState, Asset and Submission describe the payloads. examples/vanilla/server.ts implements all of it on node:http.

Static files

These files are also exported, for backends that serve them separately:

| Export | Contents | | --- | --- | | @skylivellc/lienzo-core/lienzo.css | The page stylesheet. | | @skylivellc/lienzo-core/runtime.js | The page script: modals, tabs, steps and entrance animations. | | @skylivellc/lienzo-core/schema.json | JSON Schema of the document and the site settings. | | @skylivellc/lienzo-core/data.json | The style table, icons, core actions, messages and defaults. |

License

MIT. See THIRD_PARTY_NOTICES.md for bundled third-party material.