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 🙏

© 2025 – Pkg Stats / Ryan Hefner

prismalux

v0.1.3

Published

✨ A lightweight Prisma Schema Highlighter for CLI & Node.js. Works with CommonJS and ES Modules.

Downloads

75

Readme

Prismalux 🌓 - A Zero-Dependency Prisma Schema Highlighter

npm version License: MIT

Prismalux is a lightweight, zero-dependency CLI tool & library for highlighting Prisma schema files in the terminal.

🔍 You can also highlight a specific model or enum using the --filter= option.

Just run it with npx:

npx prismalux

🚀 Features

Zero dependencies - No extra packages required
Syntax highlighting for Prisma schema files
Works as CLI & library (use as prismalux [path] or import in code)
Filter a specific model or enum using --filter=UserESM & CommonJS support


📸 Preview

Prismalux Syntax Highlighting


📦 Get Started

If you just want to run Prismalux without installing it, simply use:

npx prismalux

This will automatically find the Prisma schema in the current directory (e.g., prisma/schema.prisma).
If your schema is located elsewhere, specify the path manually:

npx prismalux --path=./path/to/schema.prisma

🔍 Highlight a Specific Model or Enum

If you only want to highlight a specific model or enum, use the --filter= option:

prismalux --filter=User

Or multiple models/enums:

Use "," or "|" to separate multiple models/enums:

prismalux --filter="User|Role"
prismalux --filter=User,Role

This will only display:

model User {
  id        String   @id @default(cuid())
  email     String   @unique
  role      Role
  createdAt DateTime @default(now())
}

You can also combine it with a custom schema path:

prismalux --path=./custom/schema.prisma --filter=Post

📦 Installation

Global Installation (CLI)

If you want to use Prismalux as a command-line tool:

npm install -g prismalux

Now you can run:

prismalux

Or specify a custom path:

prismalux --path=./path/to/schema.prisma

🎮 Usage

1️⃣ CLI Mode

# Display help
prismalux --help

# Show version
prismalux --version

# Highlight Prisma schema (auto-detects "prisma/schema.prisma")
prismalux

# Highlight a specific file
prismalux --path=./custom/schema.prisma

# Highlight a specific model or enum
prismalux --filter=User

2️⃣ Import in Code

📦 ESM (ES Modules)

import { PrismaHighlighter } from "prismalux";
const highlighter = new PrismaHighlighter();

const schema = `
model User {
  id        String   @id @default(cuid())
  email     String   @unique
  role      Role
  createdAt DateTime @default(now())
}
`;

console.log(highlighter.highlight(schema));

📦 CommonJS (CJS)

Similar to ESM

import { PrismaHighlighter } from "prismalux"; // or require("prismalux")
const highlighter = new PrismaHighlighter();

🔧 Configuration

Prismalux allows you to customize colors and disable highlighting if needed.

const highlighter = new PrismaHighlighter({
  enableColors: true,
  colors: {
    yellow: "\x1b[38;5;220m", // Custom yellow
    orange: "\x1b[38;5;214m", // Custom orange
  },
});

console.log(highlighter.highlight(schema));

To disable colors (useful for logs):

const plainHighlighter = new PrismaHighlighter({ enableColors: false });
console.log(plainHighlighter.highlight(schema));

📜 License

MIT License © Artyom Gorlovetskiy