{"id":13714797,"url":"https://github.com/omar-dulaimi/prisma-schema-sorter","last_synced_at":"2025-04-10T21:11:36.403Z","repository":{"id":40261408,"uuid":"422659793","full_name":"omar-dulaimi/prisma-schema-sorter","owner":"omar-dulaimi","description":"Prisma 2 tool to sort schema models, enums, generators and datasources","archived":false,"fork":false,"pushed_at":"2024-04-11T17:50:42.000Z","size":292,"stargazers_count":23,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T18:47:46.558Z","etag":null,"topics":["cli","prisma","prisma-schema"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/omar-dulaimi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"omar-dulaimi","custom":["https://www.buymeacoffee.com/omardulaimi"]}},"created_at":"2021-10-29T17:26:25.000Z","updated_at":"2024-10-31T00:33:50.000Z","dependencies_parsed_at":"2024-06-19T04:01:30.192Z","dependency_job_id":"4f697c92-128d-4493-9cc7-0345aef246c6","html_url":"https://github.com/omar-dulaimi/prisma-schema-sorter","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omar-dulaimi%2Fprisma-schema-sorter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omar-dulaimi%2Fprisma-schema-sorter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omar-dulaimi%2Fprisma-schema-sorter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omar-dulaimi%2Fprisma-schema-sorter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/omar-dulaimi","download_url":"https://codeload.github.com/omar-dulaimi/prisma-schema-sorter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247652909,"owners_count":20973716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","prisma","prisma-schema"],"created_at":"2024-08-03T00:00:50.103Z","updated_at":"2025-04-10T21:11:36.368Z","avatar_url":"https://github.com/omar-dulaimi.png","language":"TypeScript","funding_links":["https://github.com/sponsors/omar-dulaimi","https://www.buymeacoffee.com/omardulaimi"],"categories":[":safety_vest: Community Prisma Tools"],"sub_categories":[],"readme":"[![npm version](https://badge.fury.io/js/prisma-schema-sorter.svg)](https://badge.fury.io/js/prisma-schema-sorter)\n[![npm](https://img.shields.io/npm/dt/prisma-schema-sorter.svg)](https://www.npmjs.com/package/prisma-schema-sorter)\n[![npm](https://img.shields.io/npm/l/prisma-schema-sorter.svg)](LICENSE)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\n# Prisma Schema Sorter\n\nPrisma 2 tool to sort schema models, enums, generators and datasources\n\n\u003e Full docs can be found here: [docs](https://omar-dulaimi.github.io/prisma-schema-sorter/index.html)\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.buymeacoffee.com/omardulaimi\"\u003e\n    \u003cimg src=\"https://cdn.buymeacoffee.com/buttons/default-black.png\" alt=\"Buy Me A Coffee\" height=\"41\" width=\"174\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## Table of Contents\n\n- [Installation](#installing)\n- [Usage](#usage)\n  - [Using the CLI](#using-the-cli)\n  - [Programmatically](#programmatically)\n    - [ES Module](#es-module)\n    - [CommonJS](#commonjs)\n\n## Installation\n\nUsing npm:\n\n```bash\n$ npm install prisma-schema-sorter\n```\n\nUsing yarn:\n\n```bash\n$ yarn add prisma-schema-sorter\n```\n\n# Usage\n\nYou can use the library in multiple ways as described below.\n\n## 1- Using the CLI:\n\nWith the CLI, you get the same functionality but with greater flexibility. You could run the command as a one-off every now and then from the terminal like this:\n\u003cbr\u003e\n\u003cbr\u003e\n\n```bash\n$ npx prisma-schema-sorter sort --schema=\"./prisma/schema.prisma\"\n```\n\nYou could also keep the command as an npm script to run it as part of your workflow:\n\n```js\n{\n    \"scripts\": {\n      \"sort-schema\": \"npx prisma-schema-sorter sort --schema='./prisma/schema.prisma'\"\n    }\n}\n```\n\nOr even without the `npx` prefix:\n\n```js\n{\n    \"scripts\": {\n      \"sort-schema\": \"prisma-schema-sorter sort --schema='./prisma/schema.prisma'\"\n    }\n}\n```\n\n## 2- Programmatically:\n\n### ES Module\n\n```ts\nimport { sortPrismaSchema } from 'prisma-schema-sorter';\nawait sortPrismaSchema('./prisma/schema.prisma');\n// =\u003e Success\n```\n\n### CommonJS\n\n```js\nvar sortPrismaSchema = require('prisma-schema-sorter').sortPrismaSchema;\nsortPrismaSchema('./prisma/schema.prisma').then();\n// =\u003e Success\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomar-dulaimi%2Fprisma-schema-sorter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fomar-dulaimi%2Fprisma-schema-sorter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomar-dulaimi%2Fprisma-schema-sorter/lists"}