New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vite-plugin-type-to-schema

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-plugin-type-to-schema

> Plugin that converts types to JSON Schemas just via suffixed import

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Vite-plugin-type-to-schema

Plugin that converts types to JSON Schemas just via suffixed import

💿 Installation

pnpm i -D vite-plugin-type-to-schema # (or npm instead of pnpm)
# or
yarn add vite-plugin-type-to-schema --dev

👀 Usage

// vite.config.js
import typeToSchema from 'vite-plugin-type-to-schema';
import { defineConfig } from 'vite';

export default defineConfig({
  plugins: [typeToSchema()]
});

⚙️ Options

Source

name(optionality): defaultValue // Description
typeToSchema({
  suffix?: '?schema' // Import path suffix
  dts?: 'schemas.d.ts' // Disable (false), or change path (string) of dts file 
  options?: {} // https://github.com/vega/ts-json-schema-generator#options
})

📃 Details

See this test and fixture to learn behaviour of schema compiling

Keywords

FAQs

Package last updated on 27 Mar 2023

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc