UNPKG
create-apppaaaul
Version:
latest (2.0.54)
2.0.54
2.0.52
2.0.51
2.0.50
2.0.48
2.0.47
2.0.46
2.0.44
2.0.43
2.0.41
2.0.39
2.0.36
2.0.35
2.0.34
2.0.32
2.0.31
2.0.30
2.0.29
2.0.28
2.0.27
2.0.26
2.0.25
2.0.24
2.0.23
2.0.22
2.0.21
2.0.20
2.0.19
2.0.18
2.0.17
2.0.16
2.0.15
2.0.14
2.0.13
2.0.12
2.0.11
2.0.10
2.0.9
2.0.8
2.0.7
2.0.6
2.0.5
2.0.4
2.0.3
2.0.2
Create projects as paaauldev would
create-apppaaaul
/
dist
/
templates
/
nextjs-ts-landing-prisma
/
project
/
src
/
lib
/
db.ts
10 lines
(6 loc)
•
263 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
import
{
PrismaClient
}
from
"@prisma/client"
;
const
globalForPrisma =
global
as
unknown
as
{
prisma
:
PrismaClient
};
export
const
db = globalForPrisma.
prisma
||
new
PrismaClient
();
if
(process.
env
.
NODE_ENV
!==
"production"
) { globalForPrisma.
prisma
= db; }