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 🙏

© 2025 – Pkg Stats / Ryan Hefner

node-ssh-plus

v1.0.5

Published

Enhance functionality in the node-ssh library by providing common function implementations

Readme

Node SSH Plus

Introduction(介绍)

An extended and more user-friendly wrapper for the node-ssh package.
对 node-ssh 包进行适当的扩展使其更加易用

Usage(使用)

const opts = {
    host: '',
    port: 22,
    password: '',
    username: 'root'
}
const ssh = await SSHClient.connect(opts)
const roots = await ssh.readPath('/')
// Establishing a connection is costly - preserve the SSHClient instance for continuous use
// Close connection after completing all operations

// 建立链接的代价是高昂的, 连续使用请保存 SSHClient 实例
// 在完全使用完毕后关闭连接
ssh.close()
const opts = {
    host: '',
    port: 22,
    password: '',
    username: 'root'
}
const ssh = await SSHClient.connect(opts)
// The toProxy method creates a proxy for the ssh object
// This proxy intercepts exceptions from async methods and converts them into AsyncFunctionError events
// Note: This proxy helps implement custom connection verification
// The underlying ssh2 library's close event may not reflect connection status in real-time (can take minutes to trigger after disconnection)
// toProxy enables custom connectivity checks after failed operations

// 使用 toProxy 方法将会创建 ssh 对象的代理
// 此代理会拦截 async 方法抛出的异常转换为错误事件 Exception 中的 AsyncFunctionError
// 注意: 此代理是为了帮助用户使用自己的方法检测连接的连通性
// node-ssh 底层的 ssh2 库的 close 事件有时候不能实时的反应连接的通断, 会在断网十几分钟后触发,因此
// 使用 toProxy 在用户操作失败后使用自定义方式检测连接的连通性
const sshProxy = await ssh.toProxy()
const roots = await sshProxy.readPath('/')
// Establishing a connection is costly - preserve the SSHClient instance for continuous use
// Close connection after completing all operations

// 建立链接的代价是高昂的, 连续使用请保存 SSHClient 实例
// 在完全使用完毕后关闭连接
ssh.close()

Contribution(贡献)

  1. Synchronized on Github and 码云
  2. Submit issues for any problems
  3. 本仓库同步发布在Github码云,
  4. 有任何问题请提交 Issues