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

simple-output

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-output - npm Package Compare versions

Comparing version 1.0.1 to 2.0.0

10

index.js

@@ -34,8 +34,8 @@ var symbols = require('log-symbols');

stderr: process.stderr,
success: success,
error: error,
info: info,
message: message,
warn: warn
success,
error,
info,
message,
warn
};
{
"name": "simple-output",
"version": "1.0.1",
"version": "2.0.0",
"main": "index.js",

@@ -8,2 +8,5 @@ "files": [

],
"engines": {
"node": ">=10"
},
"description": "Output messages to stdout/stderr",

@@ -35,13 +38,11 @@ "homepage": "https://github.com/ruyadorno/simple-output",

"devDependencies": {
"grunt-contrib-jshint": "^1.1.0",
"jshint-stylish": "^2.2.1",
"load-grunt-tasks": "^3.5.2",
"time-grunt": "^1.4.0"
"jshint": "^2.10.2"
},
"dependencies": {
"log-symbols": "^2.2.0"
"log-symbols": "^3.0.0"
},
"scripts": {
"pretest": "jshint index.js test.js",
"test": "node test.js"
}
}
# simple-output
version: 1.0.1
[![NPM version](https://badge.fury.io/js/simple-output.svg)](https://npmjs.org/package/simple-output)
[![Build Status](https://travis-ci.org/ruyadorno/simple-output.svg?branch=master)](https://travis-ci.org/ruyadorno/simple-output)
[![License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://raw.githubusercontent.com/ruyadorno/simple-output/master/LICENSE)
Output messages to stdout/stderr
Pretty output messages to stdout/stderr

@@ -30,8 +30,11 @@ ## Getting Started

This module helps on testing your output data by exposing the streams to which the data gets written to.
This module helps on testing your output data by making it simpler to mock `simple-output` and its methods or use the exposed streams interface to which the data gets written to.
In order to test your output information, replace the stdout/stderr properties with an mock object containing a write function. See the example below:
In order to test your output information, replace the stdout/stderr properties with an mock object containing a write function (simulating the streams api). See the example below:
### Mock simpleOutput.stdout
```javascript
var log = require('simple-output');
var myModule = require('../my-module');

@@ -44,7 +47,22 @@ log.stdout = {

log.message('hello world');
myModule.methodThatUsesSimpleLogInfoInternally();
```
### Using a mocking library
```javascript
var requireInject = require('require-inject');
var myModule = requireInject('../my-module', {
'simple-output': {
info: msg => assert(msg, 'hello world');
}
});
myModule.methodThatUsesSimpleLogInfoInternally();
```
## License
Copyright (c) 2014 Ruy Adorno. Licensed under the MIT license.
[MIT](LICENSE) © 2019 [Ruy Adorno](http://ruyadorno.com)
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