caterpillar-human
Advanced tools
Comparing version 2.1.0 to 2.1.1
// Import | ||
var logger = new (require('caterpillar').Logger)(); | ||
var human = new (require('./').Human)(); | ||
var logger = new require('caterpillar').createLogger(); | ||
var human = new require('./').createHuman(); | ||
@@ -5,0 +5,0 @@ // Pipe logger output to our human interface, then our human interface output to stdout |
@@ -1,6 +0,10 @@ | ||
(The MIT License) | ||
Copyright (c) 2012+ Bevry Pty Ltd <us@bevry.me> | ||
Copyright (c) 2011 Benjamin Lupton <b@lupton.cc> | ||
<!-- LICENSEFILE/ --> | ||
# License | ||
Copyright © 2012+ Bevry Pty Ltd <us@bevry.me> (http://bevry.me) | ||
<br/>Copyright © 2011 Benjamin Lupton <b@lupton.cc> (http://balupton.com) | ||
## The MIT License | ||
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: | ||
@@ -11,1 +15,5 @@ | ||
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. | ||
<!-- /LICENSEFILE --> | ||
@@ -1,6 +0,7 @@ | ||
// Generated by CoffeeScript 1.6.2 | ||
// Generated by CoffeeScript 1.6.3 | ||
var Human, ansiColors, ansiStyles, err, util, _ref, | ||
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, | ||
__hasProp = {}.hasOwnProperty, | ||
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; | ||
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, | ||
__slice = [].slice; | ||
@@ -23,3 +24,4 @@ util = require('util'); | ||
this.format = __bind(this.format, this); | ||
this._transform = __bind(this._transform, this); _ref = Human.__super__.constructor.apply(this, arguments); | ||
this._transform = __bind(this._transform, this); | ||
_ref = Human.__super__.constructor.apply(this, arguments); | ||
return _ref; | ||
@@ -45,3 +47,2 @@ } | ||
var entry, message; | ||
entry = JSON.parse(chunk.toString()); | ||
@@ -54,3 +55,2 @@ message = this.format(entry); | ||
var color, _ref1; | ||
color = ((_ref1 = this.config.colors) != null ? _ref1[levelNumber] : void 0) || false; | ||
@@ -62,3 +62,2 @@ return color; | ||
var i, _i, _ref1; | ||
padding = String(padding); | ||
@@ -76,3 +75,2 @@ msg = String(msg); | ||
var i, _i, _ref1; | ||
padding = String(padding); | ||
@@ -90,3 +88,2 @@ msg = String(msg); | ||
var index, parts, text, value, _i, _len; | ||
parts = []; | ||
@@ -103,3 +100,2 @@ for (index = _i = 0, _len = args.length; _i < _len; index = ++_i) { | ||
var date, hours, minutes, month, ms, result, seconds, year; | ||
now = new Date(now); | ||
@@ -119,3 +115,2 @@ year = now.getFullYear(); | ||
var config, debugFormatter, debugMode, debugString, entryString, levelFormatter, levelString, messageString, result, seperator, textFormatter, useColors; | ||
config = this.getConfig(); | ||
@@ -160,3 +155,12 @@ entry.color = this.getColor(entry.levelNumber); | ||
module.exports = { | ||
Human: Human | ||
Human: Human, | ||
createHuman: function() { | ||
var args; | ||
args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; | ||
return (function(func, args, ctor) { | ||
ctor.prototype = func.prototype; | ||
var child = new ctor, result = func.apply(child, args); | ||
return Object(result) === result ? result : child; | ||
})(Human, args, function(){}); | ||
} | ||
}; |
118
package.json
{ | ||
"name": "caterpillar-human", | ||
"version": "2.1.0", | ||
"description": "Turn your Caterpillar logger stream into a beautiful readable format with colors and optional debug information", | ||
"homepage": "https://github.com/bevry/caterpillar-human", | ||
"keywords": [ | ||
"caterpillar", "caterpillar-transform", | ||
"console", "log", "logger", "logging", "debug", | ||
"stream", "transform", | ||
"human", "readable" | ||
], | ||
"author": "Bevry Pty Ltd <us@bevry.me> (http://bevry.me)", | ||
"maintainers": [ | ||
"Benjamin Lupton <b@lupton.cc> (https://github.com/balupton)" | ||
], | ||
"contributors": [ | ||
"Benjamin Lupton <b@lupton.cc> (https://github.com/balupton)" | ||
], | ||
"bugs": { | ||
"url": "https://github.com/bevry/caterpillar-human/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "http://github.com/bevry/caterpillar-human.git" | ||
}, | ||
"engines": { | ||
"node": ">=0.8" | ||
}, | ||
"dependencies": {}, | ||
"optionalDependencies": { | ||
"ansicolors": "~0.2.1", | ||
"ansistyles": "~0.1.1" | ||
}, | ||
"peerDependencies": { | ||
"caterpillar": "2.x" | ||
}, | ||
"devDependencies": { | ||
"readable-stream": "~1.0.2", | ||
"caterpillar": "2.x", | ||
"coffee-script": "~1.6.2", | ||
"joe": "~1.2.0", | ||
"joe-reporter-console": "~1.2.1", | ||
"chai": "~1.5.0" | ||
}, | ||
"directories": { | ||
"lib": "./out/lib" | ||
}, | ||
"scripts": { | ||
"test": "node ./out/test/caterpillar-human-test.js" | ||
}, | ||
"main": "./out/lib/caterpillar-human.js" | ||
"title": "Human Transform for [Caterpillar](https://github.com/bevry/caterpillar)", | ||
"name": "caterpillar-human", | ||
"version": "2.1.1", | ||
"description": "Turn your [Caterpillar](https://github.com/bevry/caterpillar) logger stream into a beautiful readable format with colors and optional debug information", | ||
"homepage": "https://github.com/bevry/caterpillar-human", | ||
"keywords": [ | ||
"caterpillar", | ||
"caterpillar-transform", | ||
"console", | ||
"log", | ||
"logger", | ||
"logging", | ||
"debug", | ||
"stream", | ||
"transform", | ||
"human", | ||
"readable" | ||
], | ||
"author": "2012+ Bevry Pty Ltd <us@bevry.me> (http://bevry.me), 2011 Benjamin Lupton <b@lupton.cc> (http://balupton.com)", | ||
"maintainers": [ | ||
"Benjamin Lupton <b@lupton.cc> (https://github.com/balupton)" | ||
], | ||
"contributors": [ | ||
"Benjamin Lupton <b@lupton.cc> (https://github.com/balupton)" | ||
], | ||
"bugs": { | ||
"url": "https://github.com/bevry/caterpillar-human/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "http://github.com/bevry/caterpillar-human.git" | ||
}, | ||
"engines": { | ||
"node": ">=0.8" | ||
}, | ||
"dependencies": {}, | ||
"optionalDependencies": { | ||
"ansicolors": "~0.2.1", | ||
"ansistyles": "~0.1.1" | ||
}, | ||
"peerDependencies": { | ||
"caterpillar": "2.x" | ||
}, | ||
"devDependencies": { | ||
"readable-stream": "~1.1.0", | ||
"caterpillar": "2.x", | ||
"coffee-script": "~1.6.2", | ||
"joe": "~1.3.0", | ||
"joe-reporter-console": "~1.2.1", | ||
"chai": "~1.8.1" | ||
}, | ||
"directories": { | ||
"lib": "./out/lib" | ||
}, | ||
"scripts": { | ||
"test": "node ./out/test/caterpillar-human-test.js" | ||
}, | ||
"main": "./out/lib/caterpillar-human.js", | ||
"badges": { | ||
"travis": true, | ||
"npm": true, | ||
"gittip": "bevry", | ||
"flattr": "344188/balupton-on-Flattr", | ||
"paypal": "QB8GQPZAH84N6" | ||
}, | ||
"license": { | ||
"type": "MIT" | ||
} | ||
} |
@@ -0,24 +1,42 @@ | ||
<!-- TITLE/ --> | ||
# Human Transform for [Caterpillar](https://github.com/bevry/caterpillar) | ||
[![Build Status](https://secure.travis-ci.org/bevry/caterpillar-human.png?branch=master)](http://travis-ci.org/bevry/caterpillar-human) | ||
[![NPM version](https://badge.fury.io/js/caterpillar-human.png)](https://npmjs.org/package/caterpillar-human) | ||
[![Flattr this project](https://raw.github.com/balupton/flattr-buttons/master/badge-89x18.gif)](http://flattr.com/thing/344188/balupton-on-Flattr) | ||
<!-- /TITLE --> | ||
<!-- BADGES/ --> | ||
[![Build Status](http://img.shields.io/travis-ci/bevry/caterpillar-human.png?branch=master)](http://travis-ci.org/bevry/caterpillar-human "Check this project's build status on TravisCI") | ||
[![NPM version](https://badge.fury.io/js/caterpillar-human.png)](https://npmjs.org/package/caterpillar-human "View this project on NPM") | ||
[![Gittip donate button](http://img.shields.io/gittip/bevry.png)](https://www.gittip.com/bevry/ "Donate weekly to this project using Gittip") | ||
[![Flattr donate button](https://raw.github.com/balupton/flattr-buttons/master/badge-89x18.gif)](http://flattr.com/thing/344188/balupton-on-Flattr "Donate monthly to this project using Flattr") | ||
[![PayPayl donate button](https://www.paypalobjects.com/en_AU/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QB8GQPZAH84N6 "Donate once-off to this project using Paypal") | ||
<!-- /BADGES --> | ||
<!-- DESCRIPTION/ --> | ||
Turn your [Caterpillar](https://github.com/bevry/caterpillar) logger stream into a beautiful readable format with colors and optional debug information | ||
<!-- /DESCRIPTION --> | ||
<!-- INSTALL/ --> | ||
## Install | ||
### Backend | ||
### [Node](http://nodejs.org/), [Browserify](http://browserify.org/) | ||
- Use: `require('caterpillar-human')` | ||
- Install: `npm install --save caterpillar-human` | ||
1. [Install Node.js](http://bevry.me/node/install) | ||
2. `npm install --save caterpillar-human` | ||
### [Ender](http://ender.jit.su/) | ||
- Use: `require('caterpillar-human')` | ||
- Install: `ender add caterpillar-human` | ||
### Frontend | ||
<!-- /INSTALL --> | ||
1. [See Browserify](http://browserify.org/) | ||
## Usage | ||
@@ -30,4 +48,4 @@ | ||
// Import | ||
var logger = new (require('caterpillar').Logger)(); | ||
var human = new (require('caterpillar-human').Human)(); | ||
var logger = require('caterpillar').createLogger(); | ||
var human = require('caterpillar-human').createHuman(); | ||
@@ -92,11 +110,50 @@ // Pipe logger output to our human interface, then our human interface output to stdout | ||
<!-- HISTORY/ --> | ||
## History | ||
You can discover the history inside the [History.md](https://github.com/bevry/caterpillar-human/blob/master/History.md#files) file | ||
[Discover the change history by heading on over to the `History.md` file.](https://github.com/bevry/caterpillar-human/blob/master/History.md#files) | ||
<!-- /HISTORY --> | ||
<!-- BACKERS/ --> | ||
## Backers | ||
### Maintainers | ||
These amazing people are maintaining this project: | ||
- Benjamin Lupton <b@lupton.cc> (https://github.com/balupton) | ||
### Sponsors | ||
No sponsors yet! Will you be the first? | ||
[![Gittip donate button](http://img.shields.io/gittip/bevry.png)](https://www.gittip.com/bevry/ "Donate weekly to this project using Gittip") | ||
[![Flattr donate button](https://raw.github.com/balupton/flattr-buttons/master/badge-89x18.gif)](http://flattr.com/thing/344188/balupton-on-Flattr "Donate monthly to this project using Flattr") | ||
[![PayPayl donate button](https://www.paypalobjects.com/en_AU/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QB8GQPZAH84N6 "Donate once-off to this project using Paypal") | ||
### Contributors | ||
These amazing people have contributed code to this project: | ||
- Benjamin Lupton <b@lupton.cc> (https://github.com/balupton) - [view contributions](https://github.com/bevry/caterpillar-human/commits?author=balupton) | ||
[Become a contributor!](https://github.com/bevry/caterpillar-human/blob/master/Contributing.md#files) | ||
<!-- /BACKERS --> | ||
<!-- LICENSE/ --> | ||
## License | ||
Licensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT License](http://creativecommons.org/licenses/MIT/) | ||
<br/>Copyright © 2012+ [Bevry Pty Ltd](http://bevry.me) | ||
<br/>Copyright © 2011 [Benjamin Lupton](http://balupton.com) | ||
Licensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT license](http://creativecommons.org/licenses/MIT/) | ||
Copyright © 2012+ Bevry Pty Ltd <us@bevry.me> (http://bevry.me) | ||
<br/>Copyright © 2011 Benjamin Lupton <b@lupton.cc> (http://balupton.com) | ||
<!-- /LICENSE --> | ||
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
14669
163
158
2