Socket
Book a DemoInstallSign in
Socket

@small-web/kitten

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@small-web/kitten

Type-safe global Kitten namespace.

latest
npmnpm
Version
6.1.0
Version published
Maintainers
1
Created
Source

Type-safe Kitten globals

Adds type safety to global kitten object in Kitten.

Install

npm install @small-web/kitten

Use

Kitten has a global kitten namespace that makes it easy to get started building Small Web sites and apps with it.

If you’re building something quick, that might be all you need.

e.g., In a quick Hello World example, your index.page.js might look like this:

export default () => kitten.html`
  <h1>Hello, world!</h1>
`

While that works, if you use JSDoc to implement type checking for your larger projects, and you use an editor with language intelligence (like Helix) and have static type checking turned on (e.g., as shown below or in a jsconfig.json file) you will get a “Cannot find name ‘kitten’” error.

// @ts-check
export default () => kitten.html` ← Cannot find name 'kitten'
  <h1>Hello, world!</h1>
`

To fix that, simply install the module and import the default export and it will behave exactly like the default global kitten namespace but with type safety and language intelligence while authoring.

// @ts-check
import kitten from '@small-web/kitten'

export default () => kitten.html`
  <h1>Hello, world!</h1>
`

💡 You can also import specific exports from the package, e.g., import { html } from '@small-web/kitten'.

🔗 For more help in using this module, please see the Kitten Type Safety Tutorial.

Database type safety

Kitten by default has at least two databases per project:

An internal database called _db and a custom one for you to use in your project called db.

This package provides a type-safe _db export for the internal database as the structure is well known.

If you want type safety for your custom project database, please create and use a type-safe database app module.

🔗 For a more in-depth look into database type safety, please see the Database App Modules Kitten Tutorial.

Like this? Fund us!

Small Technology Foundation is a tiny, independent not-for-profit.

We exist in part thanks to patronage by people like you. If you share our vision and want to support our work, please become a patron or donate to us today and help us continue to exist.

License

Copyright © 2023-present Aral Balkan, Small Technology Foundation Released under AGPL 3.0.

Keywords

Kitten

FAQs

Package last updated on 04 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts