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/listdocumentmodel

v0.1.0

Published

An ordered list CRDT, duplications allowed.

Downloads

2

Readme

@anchor-logoot/listdocumentmodel

This is an implementation of the AnchorLogoot algorithm from which the organization derives its name. I'm working on some good documentation about the actual algorithm itself, but in the mean time, it's undocumented. The actual datatype this represents is an ordered list that allows duplications. To create a document, simply create an instance of the ListDocumentModel class.

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.

This 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.

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 there's a few bugs. As soon as those are ironed out, it's ready to go. There will still be performance improvements necessary, though.

Development


# Install deps
yarn

# Check types
yarn run check-types

# Just lint
yarn run lint

# Build for production (and lint)
yarn run build

# Build jsdoc
yarn run build:docs

# Test
yarn run test

# Test with auto reloads
yarn run test:watch

# Get test coverage
yarn run test:cover