New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

dht-universal

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dht-universal - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

dht

2

index.min.js
(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.DhtUniversal = factory()}(typeof self !== 'undefined' ? self : this, function () {
var DhtUniversal=(()=>{var r=Object.defineProperty;var t=e=>r(e,"__esModule",{value:!0});var i={};t(i);return i;})();
var DhtUniversal=(()=>{})();
return DhtUniversal}));
{
"name": "dht-universal",
"version": "0.0.3",
"version": "0.0.4",
"description": "Universal wrapper for @hyperswarm/dht and @hyperswarm/dht-relay working in Node.js and the Browser",

@@ -23,3 +23,3 @@ "keywords": [

],
"types": "types/src/index.d.ts",
"types": "types/src/interfaces.d.ts",
"typesVersions": {

@@ -43,6 +43,5 @@ "*": {

"scripts": {
"build": "aegir build",
"test": "aegir build && c8 aegir test",
"build": "rm -rf dist && aegir build",
"test": "npm run build && c8 aegir test",
"lint": "aegir ts -p check && aegir lint --fix",
"clean": "rimraf ./dist",
"dep-check": "aegir dep-check",

@@ -71,3 +70,3 @@ "publish": "npm publish dist"

"exports": {
".": {
"./dht": {
"browser": "./esm/src/dht.browser.js",

@@ -79,3 +78,3 @@ "require": "./cjs/src/dht.js",

"browser": {
".": "./cjs/src/dht.browser.js",
"./dht": "./cjs/src/dht.browser.js",
"./esm/src/dht.js": "./esm/src/dht.browser.js",

@@ -82,0 +81,0 @@ "./cjs/src/dht.js": "./cjs/src/dht.browser.js"

@@ -5,6 +5,12 @@ # dht-universal

## Installation
```sh
npm install dht-universal
```
## Usage
```js
import { DHT } from 'dht-universal';
import { DHT } from 'dht-universal/dht'; // mind the /dht after the package name

@@ -11,0 +17,0 @@ const node = await DHT();

@@ -1,4 +0,4 @@

export type DHT = import('./index').DHT;
export function DHT(opts?: import("./index").DHTOpts | undefined): Promise<DHT>;
export type DHTOpts = import('./index').DHTOpts;
export type DHT = import('./interfaces').DHT;
export function DHT(opts?: import("./interfaces").DHTOpts | undefined): Promise<DHT>;
export type DHTOpts = import('./interfaces').DHTOpts;
//# sourceMappingURL=dht.browser.d.ts.map

@@ -1,4 +0,4 @@

export type DHT = import('./index').DHT;
export function DHT(opts?: import("./index").DHTOpts | undefined): Promise<DHT>;
export type DHTOpts = import('./index').DHTOpts;
export type DHT = import('./interfaces').DHT;
export function DHT(opts?: import("./interfaces").DHTOpts | undefined): Promise<DHT>;
export type DHTOpts = import('./interfaces').DHTOpts;
//# sourceMappingURL=dht.d.ts.map

@@ -1,29 +0,1 @@

/// <reference types="node" />
import type { Duplex, EventEmitter } from 'stream';
export interface KeyPair {
publicKey: Uint8Array;
secretKey: Uint8Array;
}
interface Server extends EventEmitter {
listen: () => Promise<void>;
address: () => {
host: string;
port: number;
publicKey: Uint8Array;
};
}
export interface NoiseSocket extends Duplex {
handshakeHash: Uint8Array;
remotePublicKey: Uint8Array;
}
export interface DHT {
destroy: () => Promise<void>;
createServer: (onconnection?: (noiseSocket: NoiseSocket) => void) => Server;
connect: (key: Uint8Array) => NoiseSocket;
defaultKeyPair: KeyPair;
}
export interface DHTOpts {
relays?: string[];
}
export {};
//# sourceMappingURL=index.d.ts.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc