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

fixture-stdout

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fixture-stdout - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

9

_example.js

@@ -8,4 +8,11 @@ var StdOutFixture = require('./');

fixture.capture( /* optionally, provide a capture fn. See readme for args. */ );
fixture.capture(
// Optionally, provide a capture fn here.
// See readme for args.
// e.g. function (string, encoding, fd) { return; }
// Return `false` to prevent the write.
// e.g. function (){ return false; }
);
// Uses intercepted version of stdout

@@ -12,0 +19,0 @@ console.log('a');

7

index.js

@@ -32,6 +32,5 @@ /**

return function (string, encoding, fd) {
var interceptorReturnedTruthy = callback(string, encoding, fd);
if (interceptorReturnedTruthy) {
write.apply(stream, arguments);
}
var interceptorReturnedFalse = false === callback(string, encoding, fd);
if (interceptorReturnedFalse) return;
else write.apply(stream, arguments);
};

@@ -38,0 +37,0 @@ })(stream.write);

{
"name": "fixture-stdout",
"version": "0.2.0",
"version": "0.2.1",
"description": "A test fixture to intercept writes to stdout.",

@@ -5,0 +5,0 @@ "main": "index.js",

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