@hashiverse/hashiverse-client-nodejs 0.0.0 → 1.0.6-rc4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -0
- package/package.json +61 -8
- package/index.js +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# @hashiverse/hashiverse-client-nodejs
|
|
2
|
+
|
|
3
|
+
Native Node.js binding for the Hashiverse client — your open-source decentralized X/Twitter replacement.
|
|
4
|
+
|
|
5
|
+
[](https://github.com/hashiverse/hashiverse/actions/workflows/publish-hashiverse-client-nodejs.yml)
|
|
6
|
+
|
|
7
|
+
This is the Node.js sibling of the [`hashiverse-client`](https://pypi.org/project/hashiverse-client/) PyPI wheel: it binds `hashiverse-lib` directly via [NAPI-RS](https://napi.rs/), producing prebuilt platform-native `.node` binaries — no in-process WASM, no browser APIs. For browser/bundler usage, see [`@hashiverse/hashiverse-client-wasm`](https://www.npmjs.com/package/@hashiverse/hashiverse-client-wasm) instead.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
npm install @hashiverse/hashiverse-client-nodejs
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Prebuilt binaries are published for Linux x64/arm64, macOS x64/arm64, and Windows x64.
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```js
|
|
20
|
+
import {
|
|
21
|
+
HashiverseClient,
|
|
22
|
+
initLogging,
|
|
23
|
+
convertTextToHashiverseHtml,
|
|
24
|
+
} from "@hashiverse/hashiverse-client-nodejs";
|
|
25
|
+
|
|
26
|
+
initLogging();
|
|
27
|
+
|
|
28
|
+
const client = await HashiverseClient.createFromKeyphrase({
|
|
29
|
+
keyPhrase: "your secret keyphrase",
|
|
30
|
+
dataDir: "/var/lib/hashiverse-bot",
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
console.log("client id:", client.clientId);
|
|
34
|
+
|
|
35
|
+
await client.submitPost(convertTextToHashiverseHtml("hello hashiverse"));
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## API
|
|
39
|
+
|
|
40
|
+
Every I/O method returns a `Promise<T>`. Properties (`clientId`, `loggedIn`) are synchronous getters.
|
|
41
|
+
|
|
42
|
+
The API mirrors the Python wheel's `HashiverseClient` (~30 methods covering posting, timelines, follows, bios, feedback, key management, and URL/trending previews) — see the [Python crate](https://github.com/hashiverse/hashiverse/tree/main/hashiverse-rust/hashiverse-client-python) for parity-level documentation of each method.
|
|
43
|
+
|
|
44
|
+
## Developing this package
|
|
45
|
+
|
|
46
|
+
- `npm ci` — install dev deps (the `@napi-rs/cli` and vitest)
|
|
47
|
+
- `npm run build:debug` — build the native binding for the host platform (debug)
|
|
48
|
+
- `npm run build` — release build
|
|
49
|
+
- `npm test` — run the offline test suite via vitest
|
|
50
|
+
- `cargo nextest run -p hashiverse-client-nodejs` — run any Rust-side unit tests directly
|
|
51
|
+
|
|
52
|
+
The `napi build` step produces `index.js`, `index.d.ts`, and a `*.node` artifact; only the first two are published with the root package — the platform-native binary is delivered via the optional per-platform sibling packages.
|
package/package.json
CHANGED
|
@@ -1,9 +1,62 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@hashiverse/hashiverse-client-nodejs",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@hashiverse/hashiverse-client-nodejs",
|
|
3
|
+
"version": "1.0.6-rc4",
|
|
4
|
+
"description": "Native Node.js binding for the Hashiverse client — your open-source decentralized X/Twitter replacement.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"types": "index.d.ts",
|
|
7
|
+
"license": "MIT OR Apache-2.0",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/hashiverse/hashiverse.git",
|
|
11
|
+
"directory": "hashiverse-rust/hashiverse-client-nodejs"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://www.hashiverse.com",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/hashiverse/hashiverse/issues"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"hashiverse",
|
|
19
|
+
"decentralized",
|
|
20
|
+
"social-network",
|
|
21
|
+
"p2p",
|
|
22
|
+
"kademlia",
|
|
23
|
+
"dht"
|
|
24
|
+
],
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=18"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"index.js",
|
|
30
|
+
"index.d.ts"
|
|
31
|
+
],
|
|
32
|
+
"napi": {
|
|
33
|
+
"binaryName": "hashiverse-client-nodejs",
|
|
34
|
+
"packageName": "@hashiverse/hashiverse-client-nodejs",
|
|
35
|
+
"targets": [
|
|
36
|
+
"x86_64-unknown-linux-gnu",
|
|
37
|
+
"aarch64-unknown-linux-gnu",
|
|
38
|
+
"x86_64-apple-darwin",
|
|
39
|
+
"aarch64-apple-darwin",
|
|
40
|
+
"x86_64-pc-windows-msvc"
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "napi build --platform --release",
|
|
45
|
+
"build:debug": "napi build --platform",
|
|
46
|
+
"artifacts": "napi artifacts",
|
|
47
|
+
"prepublishOnly": "napi prepublish --no-gh-release --skip-optional-publish",
|
|
48
|
+
"test": "vitest run",
|
|
49
|
+
"version": "napi version"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@napi-rs/cli": "^3.0.0",
|
|
53
|
+
"vitest": "^2.0.0"
|
|
54
|
+
},
|
|
55
|
+
"optionalDependencies": {
|
|
56
|
+
"@hashiverse/hashiverse-client-nodejs-linux-x64-gnu": "1.0.6-rc4",
|
|
57
|
+
"@hashiverse/hashiverse-client-nodejs-linux-arm64-gnu": "1.0.6-rc4",
|
|
58
|
+
"@hashiverse/hashiverse-client-nodejs-darwin-x64": "1.0.6-rc4",
|
|
59
|
+
"@hashiverse/hashiverse-client-nodejs-darwin-arm64": "1.0.6-rc4",
|
|
60
|
+
"@hashiverse/hashiverse-client-nodejs-win32-x64-msvc": "1.0.6-rc4"
|
|
61
|
+
}
|
|
9
62
|
}
|
package/index.js
DELETED
|
File without changes
|