A simple, privacy-focused pastebin clone built with Fastify, SQLite, and better-sqlite3.
- 🔐 Optional password-protected pastes
- ⏰ Expiring pastes (e.g. 10m, 1h, 2d)
- 🔥 "Read once" option to auto-delete after viewing
- 🕒 Optional "available_at" delay before paste becomes visible
- 🔎 Search functionality
- 🧮 Paste count and expiring soon endpoints
- 🧼 Automatic cleanup of expired pastes
Create a new paste.
Body parameters:
content(string, required)expires_in(string, e.g."10m", required)read_once('0'or'1', optional)password(string, optional)title(string, optional)available_at(string, optional, delay before visible — e.g."5m")
Retrieve a paste.
If it's password-protected, provide ?password=... in the query.
Check if a paste requires a password and get expiration time.
Delete a paste.
If it's password-protected, provide ?password=... in the query.
Get the 20 most recent unexpired and available pastes.
Returns total number of pastes stored.
Search for pastes containing a given keyword.
Get metadata about a paste (created_at, expires_at, read_once).
Lists pastes expiring in the next 10 minutes.
- Uses
better-sqlite3for sync SQLite access. - Expired pastes are cleaned up every 10 minutes.
- Timestamps are stored as Unix time (
Date.now()).
npm install
node index.js
## License
This project is licensed under the MIT License.