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

unplugin-ork

v0.0.1-alpha.1

Published

Provides virtual modules for .ork imports.

Readme

unplugin-ork

Provides virtual modules for clean .ork imports. This is the recommended way to use Ork.

Features

  • Clean .ork imports via virtual modules.
  • Instant type updates and HMR during development.
  • Works with Vite, Webpack, Rollup, and esbuild
  • Works out of the box with sensible defaults

Installation

npm install unplugin-ork

Usage

Vite

// vite.config.ts
import { defineConfig } from 'vite'
import ork from 'unplugin-ork/vite'

export default defineConfig({
  plugins: [
    ork({
      schema: './schema.prisma', // optional, defaults to './schema.prisma'
      debug: true, // optional, enables logging
    }),
  ],
})

Webpack

// webpack.config.js
const OrkPlugin = require('unplugin-ork/webpack')

module.exports = {
  plugins: [
    OrkPlugin({
      schema: './schema.prisma',
    }),
  ],
}

Rollup

// rollup.config.ts
import ork from 'unplugin-ork/rollup'

export default {
  plugins: [
    ork({
      schema: './schema.prisma',
    }),
  ],
}

esbuild

// build.ts
import { build } from 'esbuild'
import ork from 'unplugin-ork/esbuild'

build({
  plugins: [
    ork({
      schema: './schema.prisma',
    }),
  ],
})

Client Usage

Once the plugin is configured, you can use clean imports in your application:

import { OrkClient } from '@ork-orm/client'
import { PostgresDialect } from 'kysely'

// Types are automatically available via virtual modules
const client = new OrkClient(new PostgresDialect({ connectionString: process.env.DATABASE_URL! }))

// Fully typed CRUD operations
const user = await client.user.findUnique({
  where: { id: 1 },
})

How It Works

  1. Monitors your schema.prisma file for changes via watch.
  2. Parses your schema and generates TypeScript interfaces.
  3. Creates virtual .ork/types module during build.
  4. Automatically augments OrkClient with your types.
  5. Provides instant updates during development via HMR.

Options

interface OrkPluginOptions {
  /** Path to schema.prisma file (default: './schema.prisma') */
  schema?: string

  /** Directory for generated types (default: './.ork') */
  outputDir?: string

  /** Watch for schema changes (default: true in dev) */
  watch?: boolean

  /** Enable debug logging (default: false) */
  debug?: boolean

  /** Disable all output (default: false) */
  silent?: boolean

  /** Preserve terminal output instead of clearing on regeneration */
  preserveLogs?: boolean

  /** Automatically write the generated client to disk (default: true) */
  autoGenerateClient?: boolean

  /** Automatically apply migrations on schema change (default: false) */
  autoMigrate?: boolean

  /** Migration safety mode (default: 'safe') */
  autoMigrateMode?: 'safe' | 'force'

  /** Optional hook fired after schema changes are processed */
  onSchemaChange?: (info: {
    reason: string
    schemaPath: string
    generatedClient: boolean
    migrated: boolean
    migrationSkippedReason?: string
    errors?: string[]
  }) => void

  /** Project root directory (default: process.cwd()) */
  root?: string
}

Migrate an Ork project to use unplugin-ork

Step 1: Install the plugin

npm install unplugin-ork

Step 2: Add to your bundler config (see examples above)

Step 3: Remove manual generation scripts

  • Remove custom file watchers
  • Remove manual ork generate calls from build scripts
  • Clean up any custom TypeScript compilation steps

Why the Plugin is Recommended

| Feature | Manual Workflow | Plugin | | ----------------- | ------------------------ | ------------------------ | | Setup complexity | High - many manual steps | Low - single config line | | Type updates | Manual regeneration | Automatic with HMR | | Error handling | Basic CLI output | Rich contextual errors | | Build integration | Custom setup required | Built-in optimization | | Performance | No caching | Production caching | | Import style | Verbose paths | Clean .ork/types | | Development UX | Basic | Next.js-like experience |

License

Apache-2.0