UNPKG

@sodacore/prisma

Version:

Sodacore Prisma is a plugin that initialises the Prisma ORM within your project.

22 lines (21 loc) 751 B
import { BasePlugin, Utils } from '@sodacore/core'; import PrismaService from '../service/prisma'; import { file } from 'bun'; const packageJson = file(Utils.resolve(import.meta.dirname, '../../package.json')); if (!await packageJson.exists()) throw new Error('Package.json not found.'); const packageMeta = await packageJson.json(); export default class PrismaPlugin extends BasePlugin { constructor(config = {}) { super(config); this.config = config; this.name = packageMeta.name; this.version = packageMeta.version; this.description = packageMeta.description; this.author = packageMeta.author; this.setup(); } async install(app) { app.register(PrismaService); } }