A CLI and programmatic tool that alphabetically sorts Prisma schema elements, including models, enums, generators, and datasources. Version 1.5.0 (stable) requires Node.js >=18. It is zero-config, fast, lightweight, and ships TypeScript types. Unlike manual sorting or ad-hoc scripts, this tool provides a consistent, automated ordering that integrates into pre-commit hooks or CI pipelines. Released under MIT license on npm with weekly updates.
npm install prisma-schema-sorterNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates installation and both programmatic (ESM/CommonJS) and CLI usage to sort a Prisma schema file.
Use correct syntax: `prisma-schema-sorter sort --schema=./prisma/schema.prisma` (note: option value with equals sign is recommended).
Check file existence before calling sortPrismaSchema. Use try/catch.
Double-check npm package name and import path.
Use import { sortPrismaSchema } from 'prisma-schema-sorter'.Run `npm install prisma-schema-sorter` and ensure CWD has node_modules.
Use `import { sortPrismaSchema } from 'prisma-schema-sorter'`.Verify the path string points to an existing .prisma file.
No dependency data recorded yet.