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

@stephenfairchild/seaweed

v0.2.4

Published

Stores markdown in Redis as HTML

Downloads

24

Readme

Seaweed takes your markdown files and stores them as HTML in Redis.

Getting started

npm install -g @stephenfairchild/seaweed

Register a Redis URL as an environment variable:

export SEAWEED_REDIS_URL=some_redis_url

Usage

seaweed cache --directory=/home/data/content

Right now, cache is the only supported command. If you do not pass in a --directory flag then seaweed uses the current working directory.

As an example, this is a valid command: seaweed cache and it works great given the folder you're in has markdown files!

View the examples directory to see how your content should be structured in order for it to be stored correctly. You'll need to define a few attributes at the beginning of each file. We use front-matter to parse this.

The file name should be slug-like. Someting like grocery-list.md. This name will be used as the Redis key. If the key already exists, previous content will be stomped on. Maybe we can solve this with a future commit, but I've not had a need to do that yet.

Files must also all live in the same folder. Nested folders are not currently supported.

FAQ

Q: Why does this exist? What's an example use case for this?

A: I write all my notes in vim and store them in markdown files on my local machine. It's just faster for me, and I can then quickly version control it in Git. I have so many years of notes there now it would be a hard migration to get everything out and I'm not sure I want to. I've used different proprietary tools over the years but they seem to come and go so fast, and the price points change fast as well. This includes my todo lists, blog content, 1:1 notes with my manager, etc. While writing is great with vim, reading is not always so great. So this tool exists to get content into redis so that clients can access it and then enjoy the data however they please. My blog site uses node and therefore uses the node redis SDK to access blog posts. My wife has a grocery tool we use to pull the grocery notes from Redis. This is just an example.

TLDR; once markdown is hoisted out of vim the options for reading is unlimited.

Q: Why would I not want to use this tool?

A: Plenty of reasons. Here we take the unix philosophy and great strategy of "do one thing and do it well" and throw that out the window. This tool has all of the opinions, and is dependency heavy. This was originally created for my workflow. Don't use Markdown? This won't work. Dont want the cache as HTML? This won't work. Don't use Redis? Sucks to be you. TBH, I haven't had the desire to create abstractions around those areas. This tool to this point has been highly tailored to fit my workflow. If others want to open a PR to solve their use-case we'll gladly merge it and improve the tool for everybody. Until then I don't want to guess on what potential use-cases are without user feedback, especially if those use-cases are not my own.

Q: Is the HTML sanitized?

A: Nope, it's not sanitized. Feel free to open a PR to add sanitization with an existing sanitization library!