LICENSE000066400000002066151125730030005554 0ustar00The MIT License (MIT) Copyright (c) 2014 Mike McNeil Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. README.md000066400000000140151125730030006015 0ustar00reportback ========== Somewhere between a stream, a switchback, a logger, and an EventEmitter. index.js000066400000002622151125730030006212 0ustar00/** * Module dependencies */ var switchback = require('switchback'); var captains = require('captains-log'); /** * Reporter * * Hybrid between: * + switchback * + logger * + EventEmitter * + Stream * * Usage: * require('reporter') * */ module.exports = Reporter; /** * Factory * * @param {Object|Function} patch * @param {Object} defaultHandlers * @return {Reporter} a new reporter */ function Reporter (patch, defaultHandlers) { patch = patch || {}; defaultHandlers = defaultHandlers || {}; if ( typeof patch !== 'function' && (typeof patch !== 'object' || patch === null) ) { throw new Error('Invalid usage: must provide a function or object.'); } // Construct logger var logger = captains(); // Set up implicit defaults for `defaultHandlers` if (defaultHandlers.success === undefined) { defaultHandlers.success = function(){}; } if (defaultHandlers.error === undefined) { defaultHandlers.error = logger.error; } if (defaultHandlers.end === undefined) { defaultHandlers.end = function(){}; } // Construct a switchback var reporter = switchback(patch, defaultHandlers); // Mixin streaming / logging functionality reporter.write = logger.info; reporter.log = logger; /** * Mixin `extend()` method * @param {Object|Function} patch * @return {Reporter} a new reporter */ reporter.extend = Reporter; return reporter; } package.json000066400000002706151125730030007036 0ustar00{ "_args": [ [ "reportback@2.0.2", "/home/freeclou/app.optimyar.com/backend" ] ], "_from": "reportback@2.0.2", "_id": "reportback@2.0.2", "_inBundle": false, "_integrity": "sha512-EOF6vRKfXjI7ydRoOdXXeRTK1zgWq7mep8/32patt0FOnBap32eTSw6yCea/o0025PHmVB8crx5OxzZJ+/P34g==", "_location": "/reportback", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, "raw": "reportback@2.0.2", "name": "reportback", "escapedName": "reportback", "rawSpec": "2.0.2", "saveSpec": null, "fetchSpec": "2.0.2" }, "_requiredBy": [ "/strapi-generate" ], "_resolved": "https://registry.npmjs.org/reportback/-/reportback-2.0.2.tgz", "_spec": "2.0.2", "_where": "/home/freeclou/app.optimyar.com/backend", "author": { "name": "Mike McNeil" }, "bugs": { "url": "https://github.com/mikermcneil/reportback/issues" }, "dependencies": { "captains-log": "^2.0.2", "switchback": "^2.0.1" }, "description": "Somewhere between a stream, a switchback, a logger, and an EventEmitter.", "homepage": "https://github.com/mikermcneil/reportback", "keywords": [ "reportback", "switchback", "logger", "reporter", "streaming" ], "license": "MIT", "main": "index.js", "name": "reportback", "repository": { "type": "git", "url": "git://github.com/mikermcneil/reportback.git" }, "scripts": { "test": "mocha" }, "version": "2.0.2" }