Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@types/ssh2-streams
Advanced tools
@types/ssh2-streams provides TypeScript definitions for the ssh2-streams library, which is used for parsing and generating SSH2 protocol streams. This package is essential for developers who want to use ssh2-streams in a TypeScript environment, ensuring type safety and better development experience.
Creating an SSH2 Stream
This feature allows you to create an SSH2 stream and handle data events. The code sample demonstrates how to create an SSH2 stream, listen for data events, and write data to the stream.
const { SSH2Stream } = require('ssh2-streams');
const sshStream = new SSH2Stream();
sshStream.on('data', (data) => {
console.log('Data received:', data);
});
sshStream.write('Hello SSH');
Parsing SSH2 Packets
This feature allows you to parse SSH2 packets. The code sample shows how to create an SSH2 stream, listen for packet events, and write packet data to the stream.
const { SSH2Stream } = require('ssh2-streams');
const sshStream = new SSH2Stream();
sshStream.on('packet', (packet) => {
console.log('Packet received:', packet);
});
sshStream.write('Some SSH packet data');
Generating SSH2 Packets
This feature allows you to generate SSH2 packets. The code sample demonstrates how to create an SSH2 stream and generate a packet from given data.
const { SSH2Stream } = require('ssh2-streams');
const sshStream = new SSH2Stream();
const packet = sshStream.packetWrite('Some SSH packet data');
console.log('Generated packet:', packet);
The ssh2 package provides a client and server implementation of the SSH2 protocol. It is built on top of ssh2-streams and offers higher-level abstractions for SSH connections, including SFTP and exec commands. Compared to @types/ssh2-streams, ssh2 is more feature-rich and user-friendly for common SSH tasks.
node-ssh is a higher-level library for SSH connections that wraps around ssh2. It simplifies the process of connecting to SSH servers, executing commands, and transferring files. While @types/ssh2-streams focuses on low-level SSH2 protocol streams, node-ssh provides a more straightforward API for common SSH operations.
ssh2-sftp-client is a wrapper around the SFTP functionality of the ssh2 package. It provides a simplified API for interacting with SFTP servers, including file upload, download, and directory operations. This package is more specialized compared to @types/ssh2-streams, focusing specifically on SFTP operations.
npm install --save @types/ssh2-streams
This package contains type definitions for ssh2-streams v0.1.9 (https://github.com/mscdex/ssh2-streams).
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/types-2.0/ssh2-streams
Additional Details
These definitions were written by Ron Buckton https://github.com/rbuckton.
FAQs
TypeScript definitions for ssh2-streams
The npm package @types/ssh2-streams receives a total of 188,696 weekly downloads. As such, @types/ssh2-streams popularity was classified as popular.
We found that @types/ssh2-streams demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.