npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

key-share

v1.0.2

Published

Securly transfer a private/public ssh key from machine to machine

Downloads

4

Readme

Eaisly Share Keys Over The Network

This module provides small tools intended to share a private key over a private and secure network. There are two commands provided, sone to start a server and one to get from that server. There is also a node API for starting your own servers and discovering available servers on the network via ZeroConf/Bonjour.

The idea behind this is that often you need to share public or private keys to other machines. Maybe you are setting up a new machine for yourself and want to have your same private key on both, or maybe you are giving your public key to a Ops guy to put on servers. Either way it is a pain to have to email a public key or find a thumb drive to transfer a private key. This module makes it easy to spin up a server on one machine and connect to it on the other to get the key.

The other intended use of this module is for applications that use keys as an identity to share that identity between machines. Imagine a private communication app where each user is represented by their key pair and any message would be encrpyted between them. This module could be used to setup a key-sharing mechinism between the two machines.

Usage

$ npm install key-share
var keypair = require('keypair')();
var keyShare = require('./');
var Server = keyShare.Server;
var discover = keyShare.discover;
var getKey = keyShare.getKey;

var server = new Server([{
	name: 'foo',
	pass: 'foo',
	key: keypair.private
}]).listen(null, function() {
	console.log('Server listening', server.port);
});

server.on('error', function(err) {
	console.error(err);
});

var d = discover();
d.on('serviceUp', function(service) {
	getKey(service.host, service.port, 'foo', 'foo', function(err, key) {
		if (err) {
			console.error(err);
			d.stop();
			server.close();
			return;
		}
		console.log(key);
		d.stop();
		server.close();
		process.exit(0);
	});
});

CLI Commands

key-share serve

Args:

  • -k, --keyfile: Specify a key to serve, loaded from the file path provided. Default: ~/.ssh/id_rsa
  • -p, --port: Specify a port to open the server on. Default: null, an ephemeral kernal assigned port
  • -u, --user: A username to use for http basic authentication. Default: the current user, process.env.USER
  • -P, --pass: [Required] A password to use for http basic authentication
  • --no-publish: Do not publish on network via ZeroConf/Bonjour, this disabled autodiscovery
  • -s, --serviceName: The service name to publish as. Default: KeyShareServer

This will open an http server to serve the keyfile. If no port is specified it opens an ephemeral port. This will publish a service on the local network via ZeroConf/Bonjour so that clients can find your key server. Also, the http server is protected by basic auth for a minimal security layer.

key-share get

Args:

  • -h, --host: Specify the host machine for the key server
  • -p, --port: Specify a port to reach the key server on
  • -u, --user: A username to use for http basic authentication. Default: the current user, process.env.USER
  • -P, --pass: [Required] A password to use for http basic authentication
  • -s, --serviceName: The service name to publish as. Default: KeyShareServer

This will either contact the provided host/port or attempt to discover a keyserver on the network. Once the connection is established it will print the key to stdout.