A file-based database for Express.js applications. Its current stable version is 3.0.19. It stores data in JSON files on the filesystem, making it suitable for small projects or prototyping where a full database is unnecessary. Key differentiators include zero configuration, automatic file management, and tight integration with Express routing. It is released as needed on npm with no fixed cadence. Compared to alternatives like lowdb, startupDB offers simpler file handling and is specifically designed to work as middleware for Express.
npm install startupdbVerified import paths — ran on the pinned version, not inferred.
Sets up Express with startupDB middleware, demonstrating GET and POST routes to interact with a file-based 'users' collection.
Use a proper database like MongoDB or PostgreSQL for scalable applications.
Upgrade to version 3.0.0 or later, or call `req.db.save()` after pushes.
Replace `req.startupDB` with `req.db` as of v3.
Explicitly pass a configuration object with a `dataPath` property.
Run `npm install startupdb`.
Use `const startupDB = require('startupdb')` instead of `import`.Ensure `app.use(startupDB())` is called with parentheses.
Create the directory or configure a custom `dataPath` in startupDB options.