Skip to content

Instantly share code, notes, and snippets.

View serhii-levchenko's full-sized avatar

serhii-levchenko

View GitHub Profile
@serhii-levchenko
serhii-levchenko / generate-supabase-enums.md
Last active August 7, 2025 10:32
Generate enums based on Supabase types

Currently Supabase generates only types by default but it can be useful to have enums. That's how you can do it:

  1. Add your own script in package.json e.g. "generate:enums": "node ./scripts/generate-enums.js"

  2. Create ./scripts/generate-enums.js file

const fs = require('fs');
const ts = require('typescript');