menuKatnip Plugins
Tutorialkeyboard_arrow_right
Concepts and Featureskeyboard_arrow_right
How Tokeyboard_arrow_right

Why Plugins?

The main motivation behind a plugin-based system is to achieve a zero-configuration workflow. A developer should only need to express their intent—such as "I want to use Tailwind"—and things should just work. No configuration required.

Katnip comes from experience with PHP-based systems like WordPress and Laravel, where plugins provide a straightforward way to build projects. A similar approach has not gained traction in the JavaScript ecosystem, but it should.

What is a Katnip plugin?

A Katnip plugin is an NPM package with two key features that set it apart from a regular NPM package:

  1. A plugin must include the keyword katnip-plugin in its package.json file. This allows Katnip plugins to be easily discovered by searching for this keyword in the NPM registry. The list of available plugins is also syndicated and displayed on this site.

  2. A plugin must provide specific exports that align with different event channels. These exports define how the plugin interacts with a Katnip project.

Installing a Katnip plugin is done the same way as any other NPM package, using npm install or yarn add.

Core Plugins

These essential plugins, created and used by the Katnip core team, enable the setup and deployment of full-stack projects. This list includes the plugins that are part of the "core" set. For a complete list of available plugins, you can search the NPM registry or view the plugin listing here on the site, which is syndicated from npmjs.

Some of the core plugins include:

  • katnip-cloudflare: Deploys the project as a Cloudflare Worker.
  • katnip-isoq: Enables the creation of isomorphic Preact apps.
  • katnip-quickmin: Provides database functionality, including schema migration, a database administration UI, and data sync between local and remote instances.
  • katnip-rpc: Simplifies client-to-server communication using JSON-RPC.
  • katnip-static: Serves static files.
  • katnip-tailwind: Compiles and initializes Tailwind.
  • katnip-watch: Monitors file changes in the development server and restarts the server when needed.