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

hook-std

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hook-std - npm Package Compare versions

Comparing version 0.3.0 to 0.4.0

17

index.js

@@ -9,3 +9,6 @@ 'use strict';

opts = Object.assign({silent: true}, opts);
opts = Object.assign({
silent: true,
once: false
}, opts);

@@ -15,5 +18,13 @@ const std = process[type];

const unhook = () => {
std.write = write;
};
std.write = (str, enc, cb2) => {
const cbRet = cb(str, enc);
if (opts.once) {
unhook();
}
if (opts.silent) {

@@ -27,5 +38,3 @@ return typeof cbRet === 'boolean' ? cbRet : true;

return () => {
std.write = write;
};
return unhook;
}

@@ -32,0 +41,0 @@

{
"name": "hook-std",
"version": "0.3.0",
"version": "0.4.0",
"description": "Hook and modify stdout/stderr",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -58,2 +58,9 @@ # hook-std [![Build Status](https://travis-ci.org/sindresorhus/hook-std.svg?branch=master)](https://travis-ci.org/sindresorhus/hook-std)

##### once
Type: `boolean`<br>
Default: `false`
Automatically unhooks after the first call.
##### callback

@@ -60,0 +67,0 @@

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