8658a142004d77e49fec108993af0aca6bab3507
Add plugin structure Fix stale cache after posting Update to v0.9.0
Twtkpr
An ExpressJS router for serving, sharing, and updating a
twtxt.txt file.
Warning
STILL IN ALPHA: Although this is a fully-functional plugin which is actively deployed to at least one site (my own), it currently lacks documentation, examples, tests, installation flexibility, or polish (and still has a couple of bugs that need to be fixed). USE AT YOUR OWN RISK
Features
- Uses JWT (with refresh) for security.
- Allows for adding new twts and directly editing a
twtxt.txtfile from within a browser. - Includes a ull-featured GET API for your
twtxt.txtfile backed by an in-memory cache. - Supports optional drag-and-drop file upload handling with automatic linking.
Installing
Add package:
yarn add express-twtkpr
Generate hash:
yarn run get:hash
Create username and password:
yarn run set:user
Using
Use it in an express application:
import express, { Request, Response } from "express";
import twtkpr from "express-twtkpr";
// import other middleware
const app = express();
// add other middleware
app.use(
"/",
twtkpr(
{
// config options
},
),
);
// add error handler
export default app;
Starting with v0.9.0, extra features (like files uploading) were moved to the express-twtkpr-core-plugins package.
More to come!
License
Copyright (c) 2026 Eric Woodward, released under the MIT License.
Languages
TypeScript
74.2%
JavaScript
13.4%
CSS
12.4%