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

@anchor-logoot/logootish-js

v0.4.4

Published

Logootish algorithm for matrix-notepad

Downloads

2

Readme

Logootish

GitHub release (latest SemVer) Matrix GitHub Workflow Status (branch) GitHub

The Logootish CRDT algorithm used by the Matrix Notepad. See the documentation on the Notepad wiki for information about the algorithm and the TypeDoc Currently, this is only used in matrix-notepad, but the code is generic enough that it could be used in any collaboration system. At the moment, this only contains an implementation of an algorithm that I call AnchorLogoot.

Based on https://github.com/krasimir/webpack-library-starter

Design Philosophy

This algorithm, in contrast to others such as Automerge or Y.js is both data and network agnostic. This means that the ListDocumentModel contained here can be used for any ordered list that allows duplication, such as a string, array, or a rich text data type. This does mean that it's up to you to perform operations on whatever your data model is, but it's quite easy. However, if you want to save the state (in IndexedDB or wherever), you will have to implement this yourself. If you are interested in using this in your own project, please submit an issue to request that I clear up the documentation. I'm focusing on making the Nodepad work, so docs here are not at the top of my priority list.

The logootish-js codebase was forked out of Matrix Notepad and, shortly thereafter, converted to TypeScript. This is by far the most complex and important part of the Notepad.

Currently, logootish-js only supports the ListDocumentModel type. Other CRDT building blocks will be added in the future.

ListDocumentModel

Notepad Wiki TypeDoc

Note that the Wiki contains information for the over-Matrix protocol used to transfer Logootish operations. That is not part of this library.

The ListDocumentModel contains a mapping of Logootish (custom algorithm) positions to text positions in the local document. It is capable of bi-directional mappings. The Logoot equivalent of a local insertion is determined through the insertLocal method and the Logoot equivalent of a local removal is determined through the removeLocal function. The local operations that must be performed for a given Logoot operation are determined by the insertLogoot and removeLogoot methods, respectively.

Conflict resolution is mostly implemented, but mark operations need to be fixed (issues #11 and #12) before that's ready for normal usage. A new algorithm has been created known as "Anchor Logoot." This is not compatible with previous versions below 0.4.0. Currently, conflict creation is experimental and is only implemented in the model. Mark operations are not created yet.

Performance

Most of my time has been spent making this work in the first place. Because of that, it's a bit slow, but there are a few areas where it can be easily sped up (see the issues). I also have my CI generating flamegraph(s), such as the one here.

Installation

# Grab the repo
git clone https://github.com/KB1RD/logootish-js.git

# Install packages
yarn install

# Build everything
yarn run build
yarn run build:docs

# Run tests (currently broken)
yarn run test
yarn run test:watch
yarn run test:cover

Usage

Unfortunately, the last update broke most of the examples I had here. I will eventually put new usage examples here and describe the architecture.