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

generate-ssh

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

generate-ssh - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

35

index.js
"use strict";
var os = require("os");
var path = require("path");

@@ -28,6 +27,4 @@ var fs = require("fs");

cb(null, loc);
} else if (paths.length !== 0) {
} else {
findValidExecutable(paths, cb);
} else {
cb(new Error("Couldn't locate executable at given paths."));
}

@@ -37,2 +34,7 @@ });

function cleanup(keyPath) {
fs.unlink(keyPath, function () { });
fs.unlink(keyPath + ".pub", function () { });
}
module.exports.locate = function (searchPaths, cb) {

@@ -96,5 +98,3 @@ var cmd = "ssh-keygen";

cp.on("error", function () {
fs.unlink(keyPath, function () { });
fs.unlink(keyPath + ".pub", function () { });
cleanup(keyPath);
if (done) return;

@@ -107,6 +107,4 @@

cp.on("close", function (code, signal) {
if (done) {
fs.unlink(keyPath, function () { });
fs.unlink(keyPath + ".pub", function () { });
if (done) {
cleanup(keyPath);
return;

@@ -118,5 +116,4 @@ }

fs.readFile(keyPath, { encoding: "utf8" }, function (err, privateKey) {
if (err) {
fs.unlink(keyPath, function () { });
fs.unlink(keyPath + ".pub", function () { });
if (err) {
cleanup(keyPath);
done = true;

@@ -128,5 +125,4 @@

fs.readFile(keyPath + ".pub", { encoding: "utf8" }, function (err, publicKey) {
if (err) {
fs.unlink(keyPath, function () { });
fs.unlink(keyPath + ".pub", function () { });
if (err) {
cleanup(keyPath);
done = true;

@@ -137,5 +133,4 @@

done = true;
fs.unlink(keyPath, function () { });
fs.unlink(keyPath + ".pub", function () { });
done = true;
cleanup(keyPath);

@@ -142,0 +137,0 @@ cb(null, {

{
"name": "generate-ssh",
"version": "0.0.1",
"version": "0.0.2",
"author": "Sebastian Mayr <npm@smayr.name>",

@@ -5,0 +5,0 @@ "description": "A wrapper around ssh-keygen",

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

generate-ssh
###
generate-ssh is a small wrapper around the ssh-keygen tool.
generate-ssh is a small wrapper around the ssh-keygen tool.
It supports proper error handling, doesn't call the callback multiple times (:<) and has some support for locating the ssh-keygen executable on Windows.

@@ -6,0 +3,0 @@

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