simple-output
Advanced tools
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) | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4262
1
67
+ Addedlog-symbols@3.0.0(transitive)
- Removedlog-symbols@2.2.0(transitive)
Updatedlog-symbols@^3.0.0