From 387d619b4340895f57ecf68cc831ea453e0cde9e Mon Sep 17 00:00:00 2001 From: Jacob Karlsson Date: Mon, 20 May 2024 17:38:49 +0200 Subject: [PATCH] Add simple readme --- README.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..99db4aa --- /dev/null +++ b/README.md @@ -0,0 +1,39 @@ +# pzp-sdk + +JS module for helping you get started with PZP development + +https://pzp.wiki/ + +## Installation + +``` +npm install pzp-sdk +``` + +This module has a lot of peer dependencies so make sure that those get installed properly as well. + +## Usage + +```js +const { promisify: p } = require('node:util') +const { createPeer } = require('pzp-sdk') + +const { peer, account } = await createPeer() + +await p(peer.db.feed.publish)({ + account, + domain: "post", + data: { + text: 'woohoo a post' + } +}) + +await p(peer.close)() +``` + +For a bigger example of a PZP app built using the pzp-sdk you can take a look at [Zooboard](https://codeberg.org/pzp/zooboard/) + +## API + +This module has full JSDoc/TS types so typechecking and IDE autocomplete should be available (there are some problems with [promisify handling types](https://codeberg.org/pzp/pzp-db/pulls/7) though).The various plugins available under `peer.*` can be found more or less documented under the [pzp codeberg](https://codeberg.org/pzp/). There is also some protocol documentation on [the PZP website](https://pzp.wiki/). +