{"_id":"@bitxenia/wiki-version-manager","_rev":"3-8a2f3622af0b00274657b0181a2040b3","name":"@bitxenia/wiki-version-manager","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.2":{"name":"@bitxenia/wiki-version-manager","version":"0.1.2","keywords":["astrawiki"],"author":"","license":"MIT","_id":"@bitxenia/wiki-version-manager@0.1.2","maintainers":[{"name":"jm-velazquez","email":"jvelazquez@fi.uba.ar"},{"name":"pradajoaquin","email":"joaquiprada@gmail.com"}],"homepage":"https://github.com/bitxenia/wiki-version-manager#readme","bugs":{"url":"https://github.com/bitxenia/wiki-version-manager/issues"},"dist":{"shasum":"c7dafb7be750bef9450caa4667a03eefcf4c771b","tarball":"https://registry.npmjs.org/@bitxenia/wiki-version-manager/-/wiki-version-manager-0.1.2.tgz","fileCount":8,"integrity":"sha512-yCbE0ulw3Yau06GZ+I8f5McT5IhYljOeIm4aVgQ8Uj2qCrxWnehx7Y9eaTMzz3Xci3RerdLybwzKRMTY42SnyQ==","signatures":[{"sig":"MEUCIH8a4ABhP+XooMGOKe5ZVQxGy5AmHZGhVucotdyZDXQyAiEAkhKYQ55fAPfQnt1IHYbSpPKbprG7CWcp9FeVQ9QLAmE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19960},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","gitHead":"bf185760aef084e83239be2aa0a95a310ccb9946","scripts":{"test":"jest","build":"tsup","prepublishOnly":"npm version patch --no-git-tag-version && npm run build"},"_npmUser":{"name":"jm-velazquez","email":"jvelazquez@fi.uba.ar"},"repository":{"url":"git+https://github.com/bitxenia/wiki-version-manager.git","type":"git"},"_npmVersion":"10.9.0","description":"Library for managing versions in bitxenia's astra wiki.","directories":{},"_nodeVersion":"22.12.0","dependencies":{"diff-match-patch":"^1.0.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","tsup":"^8.4.0","ts-jest":"^29.3.0","typescript":"^5.8.2","@types/jest":"^29.5.14","@types/diff-match-patch":"^1.0.36"},"_npmOperationalInternal":{"tmp":"tmp/wiki-version-manager_0.1.2_1743440952172_0.49710359922750746","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-03-31T17:09:12.111Z","modified":"2025-03-31T21:33:54.514Z","0.1.2":"2025-03-31T17:09:12.350Z"},"bugs":{"url":"https://github.com/bitxenia/wiki-version-manager/issues"},"license":"MIT","homepage":"https://github.com/bitxenia/wiki-version-manager#readme","keywords":["astrawiki"],"repository":{"url":"git+https://github.com/bitxenia/wiki-version-manager.git","type":"git"},"description":"Library for managing versions in bitxenia's astra wiki.","maintainers":[{"email":"jvelazquez@fi.uba.ar","name":"jm-velazquez"},{"email":"joaquiprada@gmail.com","name":"pradajoaquin"},{"email":"bitxeniabot@gmail.com","name":"bitxeniabot"},{"email":"lucasnsotelog@gmail.com","name":"sotlucas"}],"readme":"# Wiki Version Manager\nLibrary for managing the different versions that make up each article in bitxenia's astraWiki. It allows the libraries implementing their version of the wiki to create and manage versions, as well as compile the resulting text. The user can also select from different branches within the version tree.\n\n## Installation\n```bash\nnpm install wiki-version-manager\n```\n\n## Usage\nThe library revolves around instancing a VersionManager, which keeps track of all the versions an article has.\n```typescript\nconst initialText = \"Text text text\";\nconst initialVersion = newVersion(\"\", initialText);\nconst versionManager = new VersionManager();\nversionManager.addVersion(initialVersion);\nconst followUpText = \"Text text test\";\nconst followUpVersion = newVersion(initialText, followUpText, initialVersion.id);\nversionManager.addVersion(followUpVersion);\n\nconst mainBranch = versionManager.getMainBranch();\nconst articleText = compileTextFromVersions(mainBranch);\n```\n\nThe VersionManager class also supports being instanced with an existing set of versions, which is useful for when loading an existing article.\n\n```typescript \nconst versionManager = new VersionManager(versions);\n\nconst mainBranch = versionManager.getMainBranch();\nconst articleText = compileTextFromVersions(mainBranch);\n```\n\nLastly, the library supports loading and compiling any branch in the version tree by specifying the version from which to get the branch from.\n\n```typescript \nconst versionManager = new VersionManager(versions);\n\nconst branch = versionManager.getMainBranch(versionID);\nconst articleText = compileTextFromVersions(branch);\n```","readmeFilename":"README.md"}