Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@snapshot-labs/keycard

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@snapshot-labs/keycard - npm Package Compare versions

Comparing version 0.2.1 to 0.3.0

5

dist/index.d.ts

@@ -0,1 +1,5 @@

/// <reference types="node" />
/// <reference types="node" />
import http from 'node:http';
import https from 'node:https';
type KeycardParams = {

@@ -16,2 +20,3 @@ app: string;

URL: string | URL;
agent?: http.Agent | https.Agent;
configured: boolean;

@@ -18,0 +23,0 @@ private secret;

16

dist/index.js

@@ -7,3 +7,5 @@ "use strict";

exports.Keycard = void 0;
const cross_fetch_1 = __importDefault(require("cross-fetch"));
const node_fetch_1 = __importDefault(require("node-fetch"));
const node_http_1 = __importDefault(require("node:http"));
const node_https_1 = __importDefault(require("node:https"));
const utils_1 = require("./utils");

@@ -15,2 +17,3 @@ const API_URL = 'https://locahost:3007';

URL;
agent;
configured = false;

@@ -34,2 +37,7 @@ secret;

}
const agentOptions = { keepAlive: true };
this.agent =
new URL(this.URL).protocol === 'http:'
? new node_http_1.default.Agent(agentOptions)
: new node_https_1.default.Agent(agentOptions);
console.log('[keycard] Initializing keycard...');

@@ -86,3 +94,3 @@ this.run();

const { URL, app, secret } = this;
const result = await (0, cross_fetch_1.default)(URL, {
const result = await (0, node_fetch_1.default)(URL, {
method: 'POST',

@@ -98,3 +106,5 @@ headers: {

params: { app, ...params }
})
}),
timeout: 5e3,
agent: this.agent
});

@@ -101,0 +111,0 @@ return result.json();

4

package.json
{
"name": "@snapshot-labs/keycard",
"version": "0.2.1",
"version": "0.3.0",
"license": "MIT",

@@ -18,3 +18,3 @@ "main": "dist/index.js",

"dependencies": {
"cross-fetch": "^3.1.5"
"node-fetch": "^2.7.0"
},

@@ -21,0 +21,0 @@ "eslintConfig": {

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

import fetch from 'cross-fetch';
import fetch from 'node-fetch';
import http from 'node:http';
import https from 'node:https';
import { sleep } from './utils';

@@ -25,2 +27,3 @@

URL: string | URL;
agent?: http.Agent | https.Agent;
configured = false;

@@ -46,2 +49,9 @@ private secret: string | undefined;

}
const agentOptions = { keepAlive: true };
this.agent =
new URL(this.URL).protocol === 'http:'
? new http.Agent(agentOptions)
: new https.Agent(agentOptions);
console.log('[keycard] Initializing keycard...');

@@ -121,3 +131,5 @@ this.run();

params: { app, ...params }
})
}),
timeout: 5e3,
agent: this.agent
});

@@ -124,0 +136,0 @@ return result.json();

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