{"_id":"@anchor-logoot/logootish-js","_rev":"1-f4beb02bfdc254dddfcd972c3a593582","name":"@anchor-logoot/logootish-js","dist-tags":{"latest":"0.4.4"},"versions":{"0.4.4":{"name":"@anchor-logoot/logootish-js","version":"0.4.4","description":"Logootish algorithm for matrix-notepad","main":"dist/@anchor-logoot/logootish-js.min.js","repository":{"type":"git","url":"git://github.com/KB1RD/logootish-js.git"},"scripts":{"build":"webpack --env dev && webpack --env build","build:docs":"typedoc --mode modules --out .jsdoc src/","dev":"webpack --progress --colors --watch --env dev","check-types":"tsc","test":"mocha --timeout 20000 --require ./test/babel-register.js --colors ./test/*.spec.ts ./test/*.practical.ts","test:nopractical":"mocha --timeout 10000 --require ./test/babel-register.js --colors ./test/*.spec.ts","test:mvt":"cross-env FIND_MVT=1 mocha --timeout 10000000 --require ./test/babel-register.js --colors ./test/*.practical.ts","test:watch":"mocha --timeout 10000 --require ./test/babel-register.js --colors -w ./test/*.spec.ts","test:cover":"cross-env NODE_ENV=test nyc mocha --timeout 10000 --require ./test/babel-register.js --require source-map-support/register --recursive --colors ./test/*.spec.ts","test:perf":"rm -rf .flamegraph; mkdir .flamegraph; for FILE in $(find test/*.perf.js); do 0x -D ./.flamegraph/$FILE -os --title \"$(node $FILE --name)\" $FILE; done","test:lint":"eslint ./test/*.spec.ts test/*.practical.ts","_version":"echo VERSION: $npm_package_version","upgrade-major":"./upgrade.sh"},"license":"GPL-3.0-or-later","devDependencies":{"0x":"^4.9.1","@babel/cli":"^7.10.4","@babel/core":"^7.10.2","@babel/plugin-proposal-class-properties":"^7.10.1","@babel/plugin-transform-runtime":"^7.10.4","@babel/preset-env":"^7.10.2","@babel/preset-typescript":"^7.10.1","@babel/register":"^7.10.1","@istanbuljs/nyc-config-typescript":"^1.0.1","@types/chai":"^4.2.11","@types/mocha":"^7.0.2","@types/node":"^14.0.14","@types/random":"^2.1.1","@types/seedrandom":"^2.4.28","@typescript-eslint/eslint-plugin":"^3.1.0","@typescript-eslint/parser":"^3.1.0","babel-eslint":"^10.1.0","babel-loader":"^8.1.0","babel-plugin-istanbul":"^6.0.0","babel-preset-env":"^1.7.0","chai":"^4.2.0","cross-env":"^7.0.2","eslint":"^7.1.0","eslint-config-prettier":"^6.11.0","eslint-loader":"^4.0.2","eslint-plugin-prettier":"^3.1.3","mocha":"^7.2.0","nyc":"^15.1.0","prettier":"^2.0.5","random":"^2.2.0","source-map-support":"^0.5.19","ts-loader":"^7.0.5","ts-node":"^8.10.2","typedoc":"^0.17.7","typescript":"^3.9.5","uglifyjs-webpack-plugin":"^2.2.0","webpack":"^4.43.0","webpack-cli":"^3.3.11","yargs":"^15.3.1","yarn-upgrade-all":"^0.5.2"},"nyc":{"sourceMap":false,"instrument":false},"dependencies":{"core-js":"^3.6.5","loglevel":"^1.6.8"},"gitHead":"388440177b396c1072aa56bf799953f04462f720","bugs":{"url":"https://github.com/KB1RD/logootish-js/issues"},"homepage":"https://github.com/KB1RD/logootish-js#readme","_id":"@anchor-logoot/logootish-js@0.4.4","_nodeVersion":"12.18.1","_npmVersion":"6.14.5","dist":{"integrity":"sha512-BRS0Mjt5ZDI8itPzB0GcrhyQsDFqU+RgaCJzoQsAXhH+n6P/rY6F6ep3qZx50PA7cSve4CLCvmKwq5KcXKHs0Q==","shasum":"80b5c3ab86cb148439d349f788d01d03a36c9398","tarball":"https://registry.npmjs.org/@anchor-logoot/logootish-js/-/logootish-js-0.4.4.tgz","fileCount":35,"unpackedSize":1173672,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBLycCRA9TVsSAnZWagAAmecP/1ODYMxdbbzPf50ol1EQ\nZIRFxX5hG+/rVjPXlFArO8avddmSSbkaevDJHS+hiwKV9Fbc36kE2oqS/1o7\naL9O+EnlWjLa87JqpI2hedYSMgW8xwAr/0b/1ndeFVfPyMWpF7C9d0SDmUNH\ntcddTXUUL4k6NP56xNZ1peKgPY7kas5NToF75Lxpn5zzN+d5YGeuw2Si4Dss\nvk2JOgBZEQ5EoeZu3FfKzYWxk+5UcGjBwdRo8RMHmK5Anjbrx3Xuzc4AlUOD\n9np/k2D28hyuS//wlDsl0aP0Gav6NQxUCY+is7vOec9p8VEV7mZWCFPoP9Wz\ndOCF0ePHocekL68D2mbRrhQQ5034EKu2sKL91Deupq1nATgzAlFi7FLz0cEp\nk35xpDu7EhlHikeTU37MVRuWl22s3eBSM1OH7Q+SVGJ5MiMCKnVebFRUNZ+x\nOD9DAdDCiYbV3J3vikrLqSD5KvsT6IAu2h+dryF3SG9Qk0V3J9GB9temeZse\nmdDRhJkTvilzpJ2K2Pl+npvi8dH+4h+rUUYZU5WlFdzkUiJ9Zps7bwLJtBOD\nwLiMFsj0coGoo2CEZiYkNdJG0kIIKSco/2MD5XQ0OcSkaYm7X30l+v768/r0\nnBkwjryPK/MSjUV6tKFhkdjmMN4ilorso2sIKVGqFXocSoRvSvvLWq1v1Pln\nCR3E\r\n=DS7B\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBvDD2Kr6qLt2t2BjFmOSIl9gz8fA3rmpYkrEEOsRHZcAiEAn3zZvPMkZpnD6kpYsLhi0fQc6BFE8F/46oDzcCVWPDU="}]},"maintainers":[{"name":"kb1rd","email":"kb1rd@kb1rd.net"}],"_npmUser":{"name":"kb1rd","email":"kb1rd@kb1rd.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/logootish-js_0.4.4_1594145948226_0.28094824225848547"},"_hasShrinkwrap":false}},"time":{"created":"2020-07-07T18:19:07.965Z","0.4.4":"2020-07-07T18:19:08.441Z","modified":"2022-04-04T13:56:53.735Z"},"maintainers":[{"name":"kb1rd","email":"kb1rd@kb1rd.net"}],"description":"Logootish algorithm for matrix-notepad","homepage":"https://github.com/KB1RD/logootish-js#readme","repository":{"type":"git","url":"git://github.com/KB1RD/logootish-js.git"},"bugs":{"url":"https://github.com/KB1RD/logootish-js/issues"},"license":"GPL-3.0-or-later","readme":"# Logootish\n![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/kb1rd/logootish-js)\n![Matrix](https://img.shields.io/matrix/matrix-collaboration:kb1rd.net?label=chat%20on%20%23matrix-collaboration%3Akb1rd.net&server_fqdn=matrix.org)\n![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/KB1RD/logootish-js/Yarn%20CI/dev?label=dev%20build%2Ftest)\n![GitHub](https://img.shields.io/github/license/kb1rd/logootish-js)\n\nThe Logootish CRDT algorithm used by the Matrix Notepad. See the documentation\n[on the Notepad wiki](https://github.com/KB1RD/matrix-notepad/wiki/Logootish)\nfor information about the algorithm and the [TypeDoc](https://logootish-js.matrix-notepad.kb1rd.net/)\nCurrently, this is only used in `matrix-notepad`, but the code is generic\nenough that it could be used in any collaboration system. At the moment, this\nonly contains an implementation of an algorithm that I call AnchorLogoot.\n\nBased on https://github.com/krasimir/webpack-library-starter\n\n## Design Philosophy\nThis algorithm, in contrast to others such as\n[Automerge](https://github.com/automerge/automerge) or\n[Y.js](https://github.com/yjs/yjs) is both data *and* network agnostic. This\nmeans that the `ListDocumentModel` contained here can be used for any ordered\nlist that allows duplication, such as a `string`, array, or a rich text data\ntype. This *does* mean that it's up to you to perform operations on whatever\nyour data model is, but it's quite easy. However, if you want to save the state\n(in IndexedDB or wherever), you will have to implement this yourself. If you\nare interested in using this in your own project, **please submit an issue to\nrequest that I clear up the documentation.** I'm focusing on making the Nodepad\nwork, so docs here are not at the top of my priority list.\n\nThe `logootish-js` codebase was forked out of\n[Matrix Notepad](https://matrix-notepad.kb1rd.net) and, shortly thereafter,\nconverted to TypeScript. This is by far the most complex and important part of\nthe Notepad.\n\nCurrently, `logootish-js` only supports the `ListDocumentModel` type. Other\nCRDT building blocks will be added in the future.\n\n### ListDocumentModel\n[Notepad Wiki](https://github.com/KB1RD/matrix-notepad/wiki/Logootish)\n[TypeDoc](https://logootish-js.matrix-notepad.kb1rd.net/modules/_listmodel_index_.html)\n\nNote that the Wiki contains information for the over-Matrix protocol used to\ntransfer Logootish operations. That is not part of this library.\n\nThe `ListDocumentModel` contains a mapping of Logootish (custom algorithm)\npositions to text positions in the local document. It is capable of\nbi-directional mappings. The Logoot equivalent of a local insertion is\ndetermined through the `insertLocal` method and the Logoot equivalent of a\nlocal removal is determined through the `removeLocal` function. The local\noperations that must be performed for a given Logoot operation are determined\nby the `insertLogoot` and `removeLogoot` methods, respectively.\n\nConflict resolution is mostly implemented, but mark operations need to be fixed\n(issues #11 and #12) before that's ready for normal usage. A new algorithm has\nbeen created known as \"Anchor Logoot.\" This is not compatible with previous\nversions below `0.4.0`. Currently, conflict creation is experimental and is\nonly implemented in the model. Mark operations are not created yet.\n\n## Performance\nMost of my time has been spent making this work in the first place. Because of\nthat, it's a bit slow, but there are a few areas where it can be easily sped up\n(see the issues). I also have my CI generating flamegraph(s), such as the one\n[here](https://logootish-js.matrix-notepad.kb1rd.net/flamegraph/test/listmodel-nc.perf.js/flamegraph.html#{%22merged%22:true,%22nodeId%22:null,%22excludeTypes%22:[%22cpp%22,%22regexp%22,%22v8%22,%22native%22,%22init%22,%22core%22]}).\n\n## Installation\n```sh\n# Grab the repo\ngit clone https://github.com/KB1RD/logootish-js.git\n\n# Install packages\nyarn install\n\n# Build everything\nyarn run build\nyarn run build:docs\n\n# Run tests (currently broken)\nyarn run test\nyarn run test:watch\nyarn run test:cover\n```\n\n## Usage\nUnfortunately, the last update broke most of the examples I had here. I will\neventually put new usage examples here and describe the architecture.\n","readmeFilename":"README.md"}