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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@matthewp/tinylog-tools

v0.3.0

Published

A suite of tools for working with the [Tinylogs format](https://codeberg.org/bacardi55/gemini-tinylog-rfc)

Readme

Tinylog Tools

A suite of tools for working with the Tinylogs format. A Tinylog is a gemtext file that contains individual posts sorted by date, like in a microblogging site.

Usage

Reading

The TinylogReader class is used to read a Tinylog from an external source. This source can be a string or any remote location. For example, creating a reader from a string:

import { TinylogReader } from '@matthewp/tinylog-tools';

let source = `# someperson on Station
author: someperson
avatar: 😊


## 2023-03-26 13:06 UTC
Some text

## 2023-03-25 00:47 UTC
Gemini testing 2

Another line

## 2023-03-25 00:44 UTC
More stuff`;

let reader = TinylogReader.fromString(source);

let header = await reader.header();
console.log(header.title); // -> "someperson on Station"

You can also use any external source you want, by passing in an async iterator to the source option:

import { TinylogReader } from '@matthewp/tinylog-tools';

let reader = new TinylogReader({
  source: (async function*() {
    yield '# someperson on  Station';
    yield 'author: someperson';
    // ...
  })()
})

This can be used to retrieve external sources of logs, such as from network. For example, if the tinylog is available over HTTP you could do:

import { TinylogReader } from '@matthewp/tinylog-tools';

let reader = new TinylogReader({
  source: fetch('https://example.com/tinylog')
});

Methods

The reader has the following methods you'll find useful:

reader.header()

let header = await reader.header();

The header contains metadata about the feed, the title, description, author, avatar, and license. Since headers are optional, this method will return undefined if there is no header.

reader.posts()

This starts retrieving individual posts in the feed. This is done incrementally, so you can stop reading posts any time, which prevents buffering the entire feed into memory (in the case of long feeds).

for await(let post of reader.posts()) {
  console.log(post.body);

  if(post.date < yesterday) {
    break;
  }
}

Additionally posts() returns an object with an all() method that can be used to collect all of the posts into an array:

let allPosts = await reader.posts().all();

console.log(allPosts); // [{ ... }]

Types

The header and posts are represented as:

type Header = {
  title: string;
  description: string;
  author: string;
  avatar: string;
  license: string;
};

type Post = {
  date: Date | undefined;
  body: string;
};

License

BSD-2-Clause