UNPKG

nostr-websocket-utils

Version:

Robust WebSocket utilities for Nostr applications with automatic reconnection, supporting both ESM and CommonJS. Features channel-based messaging, heartbeat monitoring, message queueing, and comprehensive error handling with type-safe handlers.

93 lines (92 loc) 2.71 kB
{ "name": "nostr-websocket-utils", "version": "0.4.1", "description": "Robust WebSocket utilities for Nostr applications with automatic reconnection, supporting both ESM and CommonJS. Features channel-based messaging, heartbeat monitoring, message queueing, and comprehensive error handling with type-safe handlers.", "main": "./dist/cjs/index.js", "module": "./dist/index.js", "types": "./dist/index.d.ts", "type": "module", "exports": { ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js", "require": "./dist/cjs/index.js", "browser": "./dist/browser/nostr-websocket-utils.min.js" }, "./crypto": { "types": "./dist/crypto/index.d.ts", "import": "./dist/crypto/index.js", "require": "./dist/cjs/crypto/index.js" } }, "scripts": { "build": "npm run build:ts && npm run build:browser", "build:ts": "tsc && tsc -p tsconfig.cjs.json && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json", "build:browser": "node esbuild.browser.mjs", "test": "vitest run", "test:watch": "vitest", "test:coverage": "vitest run --coverage", "lint": "eslint .", "lint:fix": "eslint . --fix", "prepare": "npm run build", "prepublishOnly": "npm test && npm run lint", "docs": "typedoc", "docs:watch": "typedoc --watch", "predeploy": "npm run build && npm run docs" }, "keywords": [ "nostr", "websocket", "typescript", "esm", "commonjs", "dual-module", "nostr-protocol", "websocket-client", "reconnection", "heartbeat", "message-queue", "type-safe", "browser" ], "author": "vveerrgg", "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/HumanjavaEnterprises/nostr-websocket-utils.git" }, "bugs": { "url": "https://github.com/HumanjavaEnterprises/nostr-websocket-utils/issues" }, "homepage": "https://github.com/HumanjavaEnterprises/nostr-websocket-utils#readme", "dependencies": { "@types/uuid": "^10.0.0", "nostr-crypto-utils": "^0.7.0", "pino": "^10.3.1", "uuid": "^13.0.0", "ws": "^8.19.0" }, "devDependencies": { "@eslint/js": "^10.0.1", "@types/node": "^22.19.15", "@types/ws": "^8.18.1", "@typescript-eslint/eslint-plugin": "^8.56.0", "@typescript-eslint/parser": "^8.56.0", "@vitest/coverage-v8": "^4.0.18", "esbuild": "^0.27.3", "eslint": "^10.0.3", "typedoc": "^0.28.17", "typedoc-plugin-markdown": "^4.10.0", "typescript": "^5.9.3", "vitest": "^4.0.18" }, "files": [ "dist", "examples/**/*", "README.md", "LICENSE" ], "publishConfig": { "access": "public" } }