Socket
Socket
Sign inDemoInstall

kanel-zod

Package Overview
Dependencies
2
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    kanel-zod

Zod extension for Kanel


Version published
Weekly downloads
1.7K
increased by1.07%
Maintainers
1
Install size
1.15 MB
Created
Weekly downloads
 

Readme

Source

Zod extension for Kanel

Generate Zod schemas directly from your Postgres database. This packages extends Kanel with some Zod specific features.

/** Zod schema for actor */
export const actor = z.object({
  actor_id: z.number(),
  first_name: z.string(),
  last_name: z.string(),
  last_update: z.date(),
});

Assuming you already have Kanel installed, add this with

$ npm i -D kanel-zod

generateZodSchemas

This pre-render hook will generate zod schemas for all your types. The default setup will convert the table name into camelCase which is a semi-standard Typescript convention for items that aren't types.

The

To use it, add it to your .kanelrc.js file:

const { generateZodSchemas } = require("kanel-zod");

module.exports = {
  // ... your config here.

  preRenderHooks: [generateZodSchemas],
};

Keywords

FAQs

Last updated on 18 Mar 2024

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc