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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@peculiar/ssh

v1.1.1

Published

A TypeScript library for working with SSH keys and certificates in both Node.js and browsers, built on top of WebCrypto. Provides parsing, serialization, conversion (SPKI/PKCS8 ↔ SSH), and certificate signing/verification with an extensible algorithm regi

Readme

@peculiar/ssh

CI Coverage Status

A TypeScript library for working with SSH keys and certificates in both Node.js and browsers, built on top of WebCrypto. Provides parsing, serialization, conversion (SPKI/PKCS8 ↔ SSH), and certificate signing/verification with an extensible algorithm registry.

Features

  • 🔑 Generate RSA, ECDSA, and Ed25519 keys
  • 🔐 Convert between SSH and WebCrypto formats (SPKI / PKCS8)
  • ✍️ Create and verify SSH signatures
  • 📜 Parse and build SSH certificates
  • 🌐 Works in both browsers and Node.js

Installation

npm install @peculiar/ssh

Quick Start

Generate Keys

import { SSH } from '@peculiar/ssh';

// RSA 2048
const rsa = await SSH.createKeyPair({ name: 'rsa', modulusLength: 2048 });

// Ed25519
const ed = await SSH.createKeyPair('ed25519');

// ECDSA P-256
const ec = await SSH.createKeyPair('ecdsa-p256');

Export and Import

// Export to SSH format
const sshPublic = await rsa.publicKey.toSSH();

// Import from SSH format
const imported = await SSH.import(sshPublic);

Signing and Verifying

const data = new Uint8Array([1, 2, 3]);

// Create SSH signature
const signature = await SSH.sign('ssh-ed25519', ed.privateKey, data, {
  format: 'ssh-signature',
});

// Verify SSH signature
const isValid = await SSH.verify(ed.publicKey, signature, data);
console.log('Signature valid:', isValid);

Certificates

// Create a certificate
const cert = await SSH.createCertificate(ed.publicKey)
  .setKeyId('[email protected]')
  .addPrincipal('[email protected]')
  .setType('user')
  .setValidity(Date.now(), Date.now() + 365*24*60*60*1000)
  .sign({
    signatureKey: rsa.publicKey,
    privateKey: await rsa.privateKey.toWebCrypto(),
  });

// Verify certificate
const valid = await cert.verify(rsa.publicKey);

Supported Algorithms

  • RSA - Key sizes: 2048, 3072, 4096 bits with SHA-256/SHA-512 hash selection at signing
  • Ed25519 - Modern elliptic curve signature scheme
  • ECDSA - P-256, P-384, P-521 curves with SHA-256/SHA-384/SHA-512

Platform Support

This library works in all modern browsers that support WebCrypto API and in Node.js. Here's the compatibility matrix:

| Feature | Chrome | Edge | Firefox | Safari | Opera | Chrome Android | Firefox Android | Safari iOS | Node.js | |---------|--------|------|---------|--------|-------|----------------|-----------------|------------|---------| | WebCrypto API | 37+ | 79+ | 34+ | 7+ | 24+ | 37+ | 34+ | 7+ | 15.0+ | | RSA, ECDSA | 37+ | 79+ | 34+ | 7+ | 24+ | 37+ | 34+ | 7+ | 15.0+ | | Ed25519 | 137+ | 137+ | 129+ | 17+ | 121+ | 137+ | 129+ | 17+ | 16.17+ |

For older browsers, you may need to provide a WebCrypto polyfill.

Note: Ed25519 support was added to major browsers relatively recently. For broader compatibility, consider using ECDSA or RSA algorithms.

Contributing

We welcome contributions! Please see our Contributing Guide for development setup, coding standards, and contribution guidelines.

License

MIT License - see LICENSE file for details.