UNPKG

ssb-classic

Version:

The original SSB feed format, for ssb-db2

58 lines 2.87 kB
{ "name": "ssb-classic", "version": "1.1.0", "description": "The original SSB feed format, for ssb-db2", "repository": { "type": "git", "url": "git+https://github.com/ssbc/ssb-classic.git" }, "bugs": { "url": "https://github.com/ssbc/ssb-classic/issues" }, "homepage": "https://github.com/ssbc/ssb-classic#readme", "author": "Andre Staltz <contact@staltz.com>", "contributors": [ "Anders Rune Jensen <arj03@protonmail.ch>" ], "license": "LGPL-3.0", "keywords": [ "ssb" ], "engines": { "node": ">=12" }, "main": "index.js", "files": [ "package.json.license", "LICENSES/*", "*.js" ], "dependencies": { "bipf": "^1.9.0", "is-canonical-base64": "^1.1.1", "ssb-keys": "^8.1.0", "ssb-ref": "^2.16.0" }, "devDependencies": { "c8": "^7.11.3", "husky": "4.3", "prettier": "^2.6.2", "pretty-quick": "^3.1.3", "ssb-validation-dataset": "^1.2.1", "ssb-feed-format": "^2.0.0", "tap-arc": "^0.3.4", "tape": "^5.5.3" }, "husky": { "hooks": { "pre-commit": "npm run format-code-staged" } }, "scripts": { "test": "tape test/*.js | tap-arc --bail", "format-code": "prettier --write \"*.js\"", "format-code-staged": "pretty-quick --staged --pattern \"*.js\"", "coverage": "c8 --reporter=lcov npm run test" }, "readme": "<!--\nSPDX-FileCopyrightText: 2022 Andre 'Staltz' Medeiros <contact@staltz.com>\n\nSPDX-License-Identifier: CC0-1.0\n-->\n\n# ssb-classic\n\nThis module is a plugin for ssb-db2 which implements the classic SSB feed format. You can use this module as an ssb-db2 plugin, or you can use it as a standalone tool to generate and validate classic messages.\n\n## Installation\n\n```bash\nnpm install ssb-classic\n```\n\n## Usage in ssb-db2\n\nYOU MOST LIKELY DON'T NEED TO DO THIS, because ssb-db2 bundles ssb-classic already. But maybe one day ssb-db2 won't bundle it anymore, and then you _would_ have to do this.\n\n- Requires **Node.js 12** or higher\n- Requires `secret-stack@^6.2.0`\n- Requires `ssb-db2@>=5.0.0`\n\n```diff\n SecretStack({appKey: require('ssb-caps').shs})\n .use(require('ssb-master'))\n+ .use(require('ssb-db2'))\n+ .use(require('ssb-classic'))\n .use(require('ssb-conn'))\n .use(require('ssb-blobs'))\n .call(null, config)\n```\n\n## Usage as a standalone\n\n```js\nconst ssbKeys = require('ssb-keys');\nconst classicFormat = require('ssb-classic');\n\nconst msgVal = classicFormat.newNativeMsg({\n keys: ssbKeys.generate(),\n content: {\n type: 'post',\n text: 'Hello, world!',\n },\n timestamp: Date.now(),\n previous: null,\n hmacKey: null,\n});\n```\n\nThis module conforms with [ssb-feed-format](https://github.com/ssbc/ssb-feed-format) so with ssb-classic you can use all the methods specified by ssb-feed-format.\n\n## License\n\nLGPL-3.0-only\n" }