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

openssl-commander

v0.2.0

Published

OpenSSL wrapper to run any command that OpenSSL admits.

Readme

OpenSSL-Commander

Installing

Via npm:

$ npm install openssl-commander

You also must have OpenSSL installed in your system.

TypeScript

This module includes types definitions for your amusement.

Intended usage

This wrapper is intended to mimic an OpenSSL command in the terminal.

Import as

const openssl = require('openssl-commander');

Then write the OpenSSL command as:

openssl.cmd("version").exec().stdout
/*
    OpenSSL 1.1.1f  31 Mar 2020
*/

You can include standard input before or after the command, always before exec():

const myCert = fs.readFileSync('myCert.pem')

openssl.stdin(myCert).cmd("x509", "-noout", "-text").exec().stdout
openssl.cmd("x509 -noout -text").stdin(myCert).exec().stdout

You may have noticed that the command can be an array of parameters or a single string with the rest of the command.

These are the same as running:

$ openssl x509 -noout -text < myCert.pem
          _________________   __________
               .cmd()          .stdin()

Also, you can pipe the output of one command to another OpenSSL command:

// piping (both accepted)
openssl.cmd("mycommand").exec().pipe.cmd("mycommand2").exec().stdout
openssl.cmd("mycommand").exec().cmd("mycommand2").exec().stdout

You can pass a boolean to exec() to throw on unexpected OpenSSL errors.

let myCert = "....";
openssl.stdin(myCert).cmd("x509", "-noout", "-text").exec(true)

Note: exec() will always throw if Node fails to spawn the OpenSSL process.

You can configure the OpenSSL command with:

openssl.setOpennSSLCommand(`/usr/bin/openssl`)

The error detection for the throwOnOpenSSLError option of exec() is based on mgcrea/node-openssl-wrapper's regex expresions to detect correct executions on some OpenSSL commands and subcommnads.

If you find any new regex, please, fill an issue or pull request.

// Credits to mgcrea/node-openssl-wrapper for these regex:
const expectedStderrForAction = {
    'cms': { "verify": /^verification successful/i },
    'genrsa': /^generating/i,
    'pkcs12': /^mac verified ok/i,
    'req': { "new": /^generating/i },
    'req': { "verify": /^verify ok/i },
    'rsa': /^writing rsa key/i,
    'smime': { "verify": /^verification successful/i },
    'x509': { "req": /^signature ok/i }
};