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

@aduh95/caritat

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aduh95/caritat - npm Package Compare versions

Comparing version 0.4.2 to 0.4.3

1

dist/generateNewVoteFolder.d.ts
#!/usr/bin/env node
import type { VoteMethod } from "./vote.js";
interface Options {
askForConfirmation?: (ballotContent: string) => boolean | Promise<boolean>;
subject: string;

@@ -5,0 +6,0 @@ headerInstructions?: string;

20

dist/generateNewVoteFolder.js
#!/usr/bin/env node
import { spawn } from "node:child_process";
import { once } from "node:events";
import fs from "node:fs/promises";
import path from "node:path";
import os from "node:os";
import { env, stdin, stdout } from "node:process";
import { env } from "node:process";
import * as yaml from "js-yaml";

@@ -121,21 +120,12 @@ import { generateAndSplitKeyPair } from "@aduh95/caritat-crypto/generateSplitKeyPair";

const ballotPath = path.join(directory, "ballot.yml");
let needsConfirmation = true;
let ballotContent;
while (true) {
while (needsConfirmation) {
const vote = loadYmlString(yamlString);
ballotContent = templateBallot(vote);
console.log("Here's how a ballot will look like:\n\n");
console.log(ballotContent);
stdout.write("\nIs it ready to commit? [Y/n] ");
stdin.resume();
let chars = await once(stdin, "data");
stdin.pause();
if (chars[0][0] === 0x6e || // n
chars[0][0] === 0x4e // N
) {
console.log("Vote template file is ready for edit.");
needsConfirmation = await options.askForConfirmation?.(ballotContent);
if (needsConfirmation) {
await runChildProcessAsync(env?.EDITOR ?? (os.platform() === "win32" ? "notepad" : "vi"), [voteFilePath]);
yamlString = await fs.readFile(voteFilePath, "utf-8");
}
else
break;
}

@@ -142,0 +132,0 @@ await fs.writeFile(publicKeyPath, ballot.publicKey);

{
"name": "@aduh95/caritat",
"version": "0.4.2",
"version": "0.4.3",
"files": [

@@ -5,0 +5,0 @@ "dist/"

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