Socket
Socket
Sign inDemoInstall

@types/minipass

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/minipass

Stub TypeScript definitions entry for minipass, which provides its own types definitions


Version published
Weekly downloads
135K
decreased by-17.34%
Maintainers
1
Weekly downloads
 
Created

What is @types/minipass?

@types/minipass provides TypeScript type definitions for the minipass package, which is a minimalistic stream implementation that supports both readable and writable streams. It is designed to be a simpler alternative to Node.js streams, with a focus on ease of use and performance.

What are @types/minipass's main functionalities?

Readable Stream

This feature allows you to create a readable stream using Minipass. The code sample demonstrates how to create a Minipass instance, listen for 'data' events, and write data to the stream.

const Minipass = require('minipass');
const mp = new Minipass();
mp.on('data', (chunk) => {
  console.log('Data:', chunk.toString());
});
mp.write('Hello, ');
mp.write('world!');
mp.end();

Writable Stream

This feature allows you to create a writable stream using Minipass. The code sample demonstrates how to create a Minipass instance, write data to the stream, and pipe the stream to process.stdout.

const Minipass = require('minipass');
const mp = new Minipass();
mp.write('Hello, ');
mp.write('world!');
mp.end();
mp.pipe(process.stdout);

Transform Stream

This feature allows you to create a transform stream using Minipass. The code sample demonstrates how to extend the Minipass class to create a custom transform stream that converts input data to uppercase.

const Minipass = require('minipass');
class UpperCaseStream extends Minipass {
  write(chunk) {
    super.write(chunk.toString().toUpperCase());
  }
}
const mp = new UpperCaseStream();
mp.pipe(process.stdout);
mp.write('hello, ');
mp.write('world!');
mp.end();

Other packages similar to @types/minipass

FAQs

Package last updated on 01 Aug 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc