Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@happygloss/through2

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@happygloss/through2

**Installation**

  • 1.5.2
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

through2-simplified

Installation

yarn add @happygloss/through2

Usage

import Through2, {BufferEncoding } from '@happygloss/through2'
import { TransformCallback } from 'stream'

// unknown is a type-safe variant of any, provide the this context as a type param.
function transform(this: Through2, chunk: unknown, enc: BufferEncoding, callback: TransformCallback) {
  const updated = chunk.toString() + '!'
  this.push(updated)
  callback()
}

const through2 = new Through2(transform)

Development

We use Readable and Transform streams when testing the code, we don't rely on other modules such as spigot, from, concat when testing. To test the code, use:

yarn test

To run tests with coverage:

yarn cover

FAQs

Package last updated on 12 Sep 2021

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