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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@mysteryhouse/crackpot

v0.7.1

Published

An aggressively old-fashioned hypertext document server that aims to capture the spirit of the early web while avoiding many of its headaches

Downloads

185

Readme

Crackpot

Crackpot is an aggressively old-fashioned hypertext document server that aims to capture the spirit of the early web while avoiding many of its headaches.

You may like Crackpot if:

  • You are old enough to remember how exciting, intuitive, and flexible it was to be able to just upload a text file to a server and have it be immediately viewable by anyone on the internet
  • You are also old enough to remember what a pain in the neck it is manage more than a handful of hand-coded HTML files
  • You tell yourself that you'd update your web site more often if you didn't have to completely relearn some SSG every few months

Requirements

  • Node.js 20 or later
  • A directory with some files you want to serve

Features

  • Automatically renders common text file formats as HTML:
  • Automatically generates primary navigation and secondary navigation
  • Automatically generates directory indexes
  • Automatically generates an RSS feed
  • Automatically resizes images

Quick Start

Open a terminal and run:

npx crackpot -d /path/to/your/files

Once Crackpot starts you should be able to open a browser and navigate to http://localhost:1996.

You can also install Crackpot globally with your preferred package manager:

npm

npm install -g @mysteryhouse/crackpot

pnpm

pnpm install -g @mysteryhouse/crackpot

yarn

yarn global add @mysteryhouse/crackpot

...after which you should be able to run it by typing crackpot.

Unlisted and Hidden Files

  • Files whose names start with a single underscore (_) can be accessed directly, but will not be included in navigation, auto-generated indexes, or the RSS feed.
  • Files whose names start with a dot (.) or double underscore (__) will be treated as hidden, and will not be accessible via the browser.

Needless to say, you should never ever put any truly sensitive information in any web server's document root, but being able to hide documents while you work on them is handy.

Images

Images served by Crackpot are automatically resized to fit within 300x300 pixels. Smaller images will not be resized.

If you want to include an image with different dimensions, you can add a query string argument to the image path, for example:

![Some Alt Text](./my-image.jpg?s=640x480)

Other media

All-other files are served as-is with MIME type as a best-guess based on their extensions.

Configuration

To see a list of startup options, run npx @mysteryhouse/crackpot --help:

Options:
  -V, --version                          output the version number
  -d, --docroot <path>                   The directory to serve files from (default: ".")
  -p, --port <port>                      The port to listen on (default: "1996")
  -b, --bind <address>                   The address to bind to (default: "0.0.0.0")
  -u, --baseUrl <url>                    The base URL that should be used for RSS and other permalinks. If not provided, it will be calculated from bind and port, and use an http:// prefix.
  -n, --site-name <name>                 The name of your website (default: "ludwig")
  -sd, --site-description <description>  A brief description of your website
  -f, --fediverse-profile <url>          Add a verification link to your fediverse profile
  -s, --image-size <size>                The default width and height that images will be resized to, in the format '[width]x[height]' (default: "300x300")
  -h, --help                             display help for command

Styling

Crackpot provides a default stylesheet at /style.css, but you can override it by placing your own styles.css file in your document root.

Caveat

This is a very early release; features are half-baked, occasionally broken, and likely to change. Use at your own risk.