npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@postr/core

v1.10.3

Published

A micropub endpoint

Readme

Postr

What is this?

This is a nodejs IndieWeb backend, mainly consisting of a micropub endpoint that can be run as a module in an express project.

It includes a bunch of cool features (or I think they're cool anyway...)

Features

  • Supports micropub posting, actions and queries
  • Media endpoint
  • Automatically downloads images to your local media folder
  • Image resizing
  • Markdown parsing
  • Automatic webmention sending
  • Grabs referenced urls as microformats2
  • Highly extensible via middleware
  • Supports multiple database adapters
  • Realtime updates and data replication

Example Site

An example site is available to play around with on glitch at https://glitch.com/~postr

Install

npm install @postr/core

Usage

const express = require('express')
const micropubEndpoint = require('@postr/core')
const app = express()
const myEndpoint = micropubEndpoint(/_config_/)

app.use('/micropub', myEndpoint.router)
app.listen(80)

Config

Configuration can be passed as an object when using postr as a JavaScript module.

Options

const options = {
  permalinkPattern: ':siteBaseUrl/:year/:month/:day/:slug', // (String) What your site permalinks look like. Written in express style. Must include year month and day at the moment
  sendWebmentions: true, // (Boolean) Send webmentions automatically or not
  formatContent: true, // (Boolean) Whether or not to format plain text content
  getRefs: true, // (Boolean) Enables parsing of referenced urls
  downloadExternalMedia: true, // (Boolean) Whether or not to download referenced media files (`photo`, `audio` and `video` properties). They will be saved to the default media endpoint
  syndication: [], // (Array) - Your syndication providers that will be returned in micropub config queries
  mediaDir: __dirname + '/../media', // (String) The local media directory
  dbName: 'micropubendpoint', // (String) The database name. Note: Must adhere to RxDB rules
  dbAdapter: 'leveldb', // (String|Object) The database adapter. Note: To use a different adapter you must also load the appropriate RxDB plugin
  imageSizes: {}, // (Object) A set of sizes to scale images to. should be in the format `{name: [width, height]}` eg. `{thumbnail: [200, 200], large: [1800, 0]}`, Note: If you pass 0 as the height the image will retain its original ratio
  siteBaseUrl: '', // (String)* The base url of your website with no trailing slash. Eg. `https://grant.codes`
  endpointBaseUrl: '', // (String)* The base url of this media endpoint with no trailing slash. Eg. `https://micropub.grant.codes` or `https://grant.codes/micropub`
  mediaBaseUrl: '', // (String)* The base url of your media folder. You should statically serve the `mediaDir` and set this option to the url
  dbPassword: '', // (String)* The database password
  tokenEndpoint: '', // (String)* Your token endpoint. Used for authenticating requests
  dangerousDevMode: false, // (Boolean) Set to true and the endpoint will skip checking tokens. It may do more in the future
  dangerousPermanentToken: '', // (String) A permanent auth token that may be useful if you are using your own tools to communicate with your site
  mediaEndpoint: '', // (String) If you want to post media to a different media endpoint pass the url here and all file storage will be handled by your media endpoint. No image resizing will be done.
}