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

@best-skn/elysia-html-types

v1.0.1

Published

A Simple Type Definition Extension Library For Elysia.js HTML

Downloads

9

Readme

SKN Elysia.js HTML Type Extension Library

TypeScript

NPM Version MIT License

 

Introduction:

This is a simple TypeScript Type Extension Library for Elysia.js HTML

I made this library so that I can use it in all of my Elysia.js projects without writing the same codes over and over again

 

Details:

JSXChildrenProps Interface

  • As the name suggests, it is an interface for JSX props holding children property
  • For usage instruction, see Usage section

JSXBasicProps Interface

  • An interface that extends JSXChildrenProps
  • In addition to children property, it holds lang, desc, kwd, title, icn properties
  • This interface is good for HTML meta info
  • For usage instruction, see Usage section

JSXComponent Type

  • This type definition is for JSX Component
  • It takes a Generic type as its props type
  • Returns a JSX component
  • For usage instruction, see Usage section

JSXComponentNoProps Type

  • As the name suggests, this type definition is just like JSXComponent but without props
  • It does not need a Generic type as it has no props
  • Returns a JSX component
  • For usage instruction, see Usage section

 

Use Case:

  • Elysia.js
  • Elysia.js HTML

 

Requirements:

This library has peer dependency for Elysia.js 1.2.25. It may or may not work on 2.x

This library is intended to be used in Elysia.js HTML of minimum 1.2.0. It may or may not work on 2.x

 

Usage:

To install the package, type the following in console

npm add -D @best-skn/elysia-html-types
#or
yarn add -D @best-skn/elysia-html-types
#or
pnpm add -D @best-skn/elysia-html-types
#or
bun add -D @best-skn/elysia-html-types

Create a directory called types in the root location of your project, and create a file called elysia.d.ts, then do this

import "@best-skn/elysia-html-types";

Check your tsconfig.json if includes property has **/*.ts, **/*.tsx or not otherwise the type definition file may not work

Now Inside your Elysia.js Project, use the package like this (Just an example)

JSXChildrenProps Type:

For any JSX Component, do the following

import { Html, type JSXChildrenProps, type JSXComponent } from "@elysiajs/html";

const HomeRoute: JSXComponent<JSXChildrenProps> = (props) => {
  const { children } = props;

  return (
    <div>{children}</div>
  );
};

export default HomeRoute;

JSXBasicProps Type:

For any kinds of JSX Component, do the following

import { Html, type JSXBasicProps, type JSXComponent } from "@elysiajs/html";

const BaseHtml: JSXComponent<JSXBasicProps> = (props) => {
  const { children, lang, desc, kwd, title, icn } = props;

  return (
    <html lang={lang}>
      <head>
        <meta charset="UTF-8" />

        <meta name="viewport" content="width=device-width, initial-scale=1.0" />

        <meta name="description" content={desc ?? "Elysia Web Application"} />

        <meta name="keywords" content={kwd ?? "Elysia, Bun, TypeScript"} />

        <title>{title ?? "Elysia App"}</title>

        <link rel="icon" href={icn ?? "/public/icons/logo.svg"} />
      </head>

      <body>
        <main>{children}</main>
      </body>
    </html>
  );
};

export default BaseHtml;

JSXComponent Type:

For your JSX Component, do the following

import { Html, type JSXChildrenProps, type JSXComponent } from "@elysiajs/html";

const HomeRoute: JSXComponent<JSXChildrenProps> = (props) => {
  const { children } = props;

  return (
    <div>{children}</div>
  );
};

export default HomeRoute;

JSXComponentNoProps Type:

For JSX Component, do the following

import { Html, type JSXComponentNoProps } from "@elysiajs/html";

const HomeRoute: JSXComponentNoProps = () => (<div>Hello from Elysia!</div>);

export default HomeRoute;

 

Dedicated To:

  • 👩‍🎨Prodipta Das Logno & 🧛‍♀️Atoshi Sarker Prithula: The two most special ladies of my life. My best wishes will always be with you two. May you two always be happy.
  • 💯My Parents: The greatest treasures of my life ever.

 

License:

Copyright (C) 2024 SKN Shukhan

Licensed under the MIT License