How to use the hook-std.stdout function in hook-std

To help you get started, we’ve selected a few hook-std examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github twitch-js / twitch-js / test / logger.js View on Github external
it('should log to the console', () => {
    let out = '';

    const unhook = hookStd.stdout({ silent: true }, output => {
      out += output;
    });

    log.setLevel('info');
    log.info('foobar');

    unhook();

    const expected = out.trim();
    expected.should.containEql('info: foobar');
  });
});
github tmijs / tmi.js / test / logger.js View on Github external
it("logs to the console", function() {
		var out = '';

		var unhook = hookStd.stdout({silent: true}, function(output) {
			out += output;
		});

		log.setLevel('info');
		log.info('foobar');

		unhook();

		var expected = out.trim();
		expected.should.containEql('info: foobar');
	});
});

hook-std

Hook and modify stdout and stderr

MIT
Latest version published 3 years ago

Package Health Score

70 / 100
Full package analysis

Popular hook-std functions