{"_id":"ot-text-tp2","_rev":"4-8a88fa029b40d0d8b457a418f991a706","name":"ot-text-tp2","description":"OT type for text, with transform property 2 (suitable for P2P)","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"ot-text-tp2","version":"1.0.0","description":"OT type for text, with transform property 2 (suitable for P2P)","main":"lib/index.js","directories":{"test":"test"},"scripts":{"test":"mocha test"},"repository":{"type":"git","url":"git://github.com/ottypes/text-tp2.git"},"keywords":["ot","text","sharejs"],"author":{"name":"Joseph Gentle","email":"me@josephg.com"},"license":"ISC","bugs":{"url":"https://github.com/ottypes/text-tp2/issues"},"homepage":"https://github.com/ottypes/text-tp2","devDependencies":{"ot-fuzzer":"^1.0.0","mocha":"^1.20.1","coffee-script":"^1.7.1"},"_id":"ot-text-tp2@1.0.0","dist":{"shasum":"4591fce238f85605f79e95de43e0b233387e133b","tarball":"https://registry.npmjs.org/ot-text-tp2/-/ot-text-tp2-1.0.0.tgz","integrity":"sha512-eJXrd42qm4LNHGno4JHPy8Xj1y9MBVQv60AdrvRcubsS723cVWTvV8J9ZROJfg0I/1tKe+roFEmJp83nwpBOhA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCTqvGz2YRy5TeKZo9Wjof3Eg79J/NUk++g/OsUiHeHKQIhAIjyd6IrdAdIAB+ayBnsAfFifQ2BC3nFs4X3KHILTkwd"}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"josephg","email":"me@josephg.com"},"maintainers":[{"name":"josephg","email":"me@josephg.com"}]}},"readme":"# TP2 Text OT type\n\nThis is an implementation of OT for text which implements [transform property\n2](http://en.wikipedia.org/wiki/Operational_transformation#Convergence_properties)\nthrough the use of tombstones. As such, this data structure can be used in\npeer-to-peer situations (with concurrency control algorithms which do not have\na single source of truth).\n\nThis code following this spec from lightwave:\nhttp://code.google.com/p/lightwave/source/browse/trunk/experimental/ot/README\n\nDocuments are a string with tombstones inserted throughout. For example, 'some\n', (2 tombstones), 'string'. Tombstones indicate positions where characters\nonce existed. They are important for many parties to agree on convergence.\n\nThis is encoded in a document as ['some ', (2 tombstones), 'string']\n(It should be encoded as {s:'some string', t:[5, -2, 6]} because thats\nfaster in JS, but its not.)\n\nJust like in the 'normal' [plaintext type](/ottypes/text), Ops are lists of\ncomponents which iterate over the whole document.\n\nComponents are either:\n\nCompoent   | Description\n---------- | ------------\n`N`        | Skip N characters in the original document\n`{i:'str'}`| Insert 'str' at the current position in the document\n`{i:N}`    | Insert N tombstones at the current position in the document\n`{d:N}`    | Delete (tombstone) N characters at the current position in the document\n\nFor example:\n\n```\n[3, {i:'hi'}, 5, {d:8}]\n```\n\nSnapshots are lists with characters and tombstones. Characters are stored in strings\nand adjacent tombstones are flattened into numbers.\n\nEg, the document: 'Hello .....world' ('.' denotes tombstoned (deleted) characters)\nwould be represented by a document snapshot of ['Hello ', 5, 'world']\n\n\n---\n\n# License\n\nAll code contributed to this repository is licensed under the standard MIT license:\n\nCopyright 2011 ottypes library contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following condition:\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n","maintainers":[{"name":"josephg","email":"me@josephg.com"}],"time":{"modified":"2022-06-23T03:59:33.542Z","created":"2014-07-17T23:35:30.631Z","1.0.0":"2014-07-17T23:35:30.631Z"},"homepage":"https://github.com/ottypes/text-tp2","keywords":["ot","text","sharejs"],"repository":{"type":"git","url":"git://github.com/ottypes/text-tp2.git"},"author":{"name":"Joseph Gentle","email":"me@josephg.com"},"bugs":{"url":"https://github.com/ottypes/text-tp2/issues"},"license":"ISC","readmeFilename":"README.md"}