express-twtkpr-core-plugins
Warning
STILL IN ALPHA: Although this is a fully-functional set of plugins which are 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
A collection of 3 recommended plugins to expand the functionality of your express-twtkpr installation.
These plugins include:
emojiButton: Adds a simple button to the textarea which appends an emoji to your twt.postToMastodon: Enables automatic posting to your Mastodon account.uploadButton: Adds support for drag-and-drop and button-driven file uploads, with optional automatic hashing, renaming, metadata stripping, and resizing of images.
import express, { Request, Response } from "express";
import twtkpr from "express-twtkpr";
import {
emojiButton,
postToMastodon,
uploadButton,
} from "express-twtkpr-core-plugins";
// import other middleware
const app = express();
// add other middleware
app.use(
"/",
twtkpr(
{
// config options
},
[emojiButton, postToMastodon, uploadButton],
),
);
// add error handler
export default app;
emojiButton
Adds a simple button to the textarea which appends an emoji to your twt.
- Uses jwz's emoji.js and emoji.css files to generate the button.
- Keeps track of recently used emoji.
- Includes support for a massive list of emojis.
Usage
import express, { Request, Response } from "express";
import twtkpr from "express-twtkpr";
import {
emojiButton,
postToMastodon,
uploadButton,
} from "express-twtkpr-core-plugins";
// import other middleware
const app = express();
// add other middleware
app.use(
"/",
twtkpr(
{
// config options
},
[emojiButton],
),
);
// add error handler
export default app;
postToMastodon
Enables automatic posting to your Mastodon account.
- Follows principle of POSSE (Publish Own Site, Syndicate Elsewhere)
Usage
For it to work, you MUST include both of the following values:
application_token: On your Mastodon client, go to "Preferences", then "Development". Create a new application, then look for the value "Your access token".server_url: The root URL for your Mastodon server (ex: "https://toot.cafe")
The preferred way to include them WILL BE via ENV variables (once the work is complete).
import express, { Request, Response } from "express";
import twtkpr from "express-twtkpr";
import {
emojiButton,
postToMastodon,
uploadButton,
} from "express-twtkpr-core-plugins";
// import other middleware
const app = express();
// add other middleware
app.use(
"/",
twtkpr(
{
plugins: {
postToMastodon: {
application_token: "<TOKEN>", // or via ENV variable TWTKPR_PLUGIN_PTM_APP_TOKEN
server_url: "<URL>", // or via ENV variable TWTKPR_PLUGIN_PTM_APP_TOKEN
},
},
// other config options
},
[postToMastodon],
),
);
// add error handler
export default app;
uploadButton
Adds support for drag-and-drop and button-driven file uploads, with optional automatic hashing, renaming, metadata stripping, and resizing of images.
import express, { Request, Response } from "express";
import twtkpr from "express-twtkpr";
import {
emojiButton,
postToMastodon,
uploadButton,
} from "express-twtkpr-core-plugins";
// import other middleware
const app = express();
// add other middleware
app.use(
"/",
twtkpr(
{
// config options
},
[uploadButton],
),
);
// add error handler
export default app;
License
Copyright (c) 2026 Eric Woodward, released under the MIT License.