{"id":18192,"library":"capstone-database","title":"capstone-database","description":"capstone-database is a database repository package for the TKR Computers e-commerce application. Current stable version is 1.0.125. It is released on npm and requires @prisma/client >=5 as a peer dependency. This package provides database access and business logic for a computer products online store. Key differentiators include integration with Prisma ORM and a focus on e-commerce features like product catalogs, cart management, and secure checkout. It is designed for use with Node.js and TypeScript.","status":"active","version":"1.0.125","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install capstone-database","lang":"bash","label":"npm"},{"cmd":"yarn add capstone-database","lang":"bash","label":"yarn"},{"cmd":"pnpm add capstone-database","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required as peer dependency to interact with the database via Prisma ORM","package":"@prisma/client","optional":false}],"imports":[{"note":"This is an ESM-only package; require() will fail. Use import statement.","wrong":"const capstoneDatabase = require('capstone-database')","symbol":"default","correct":"import capstoneDatabase from 'capstone-database'"},{"note":"PrismaClient is re-exported from capstone-database; use separate import from @prisma/client for clarity.","wrong":"import { PrismaClient } from 'capstone-database'","symbol":"PrismaClient","correct":"import { PrismaClient } from '@prisma/client'"},{"note":"TypeScript types are exported; use type import for better tree-shaking.","wrong":"","symbol":"type definitions","correct":"import type { Product, CartItem } from 'capstone-database'"}],"quickstart":{"code":"import capstoneDatabase from 'capstone-database';\nimport { PrismaClient } from '@prisma/client';\n\nconst prisma = new PrismaClient();\n\nasync function main() {\n  const products = await capstoneDatabase.getProducts(prisma);\n  console.log(products);\n}\n\nmain().catch(console.error);","lang":"typescript","description":"Initializes Prisma client, imports the main database module, and fetches product list."},"warnings":[{"fix":"Update @prisma/client to version 5 or higher.","message":"Requires @prisma/client version >=5. Versions below 5 are not supported and will cause runtime errors.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Replace calls to `getCart` with `fetchCart`.","message":"The `getCart` method has been deprecated in favor of `fetchCart`. `getCart` will be removed in v2.","severity":"deprecated","affected_versions":">=1.0.100"},{"fix":"Use the default import directly without the `new` keyword.","message":"The package exposes a default export that is an object, not a class. Attempting to use `new` will throw an error.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run `npm install capstone-database` in your project directory.","cause":"Package not installed or missing from node_modules.","error":"Error: Cannot find module 'capstone-database'"},{"fix":"Access methods on the imported object, e.g., `capstoneDatabase.getProducts()`.","cause":"Default export is an object, not a function. Tried to invoke directly.","error":"TypeError: capstoneDatabase is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}