@musakui/fedi
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -13,3 +13,3 @@ { | ||
}, | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"type": "module", | ||
@@ -20,3 +20,3 @@ "files": [ | ||
"exports": { | ||
"hs": { | ||
"./hs": { | ||
"node": "./lib/hs/node.js", | ||
@@ -23,0 +23,0 @@ "default": "./lib/hs/index.js" |
@@ -5,1 +5,29 @@ # Fediverse Tools | ||
## Install | ||
```sh | ||
$ npm i @musakui/fedi | ||
``` | ||
## Usage | ||
### HTTP Signatures | ||
```js | ||
import * as HS from '@musakui/fedi/hs' | ||
import { readFileSync } from 'fs' | ||
HS.useKey('[keyId]', readFileSync('./private.pem')) | ||
const resp = await HS.sendRequest({ | ||
url: 'https://mastodon.social/inbox', | ||
headers: { | ||
'content-type': 'application/activity+json', | ||
}, | ||
body: JSON.stringify({ | ||
// some ActivityPub object | ||
}), | ||
}) | ||
console.log(await resp.text()) | ||
``` |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
10049
33
2