caterpillar-browser
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -5,12 +5,12 @@ // ==================================== | ||
// Logger | ||
var logger = new (require('caterpillar').Logger)({level:7}); | ||
var logger = require('caterpillar').createLogger({level:7}); | ||
var output = logger | ||
.pipe( | ||
new (require('caterpillar-filter').Filter)() | ||
require('caterpillar-filter').createFilter() | ||
) | ||
.pipe( | ||
new (require('caterpillar-human').Human)() | ||
require('caterpillar-human').createHuman() | ||
) | ||
.pipe( | ||
new (require('./').Browser)() | ||
require('./').createBrowser() | ||
); | ||
@@ -17,0 +17,0 @@ |
@@ -1,5 +0,9 @@ | ||
(The MIT License) | ||
Copyright (c) 2013+ Bevry Pty Ltd <us@bevry.me> | ||
<!-- LICENSEFILE/ --> | ||
# License | ||
Copyright © 2013+ Bevry Pty Ltd <us@bevry.me> (http://bevry.me) | ||
## 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: | ||
@@ -10,1 +14,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 Browser, _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; | ||
@@ -12,3 +13,4 @@ Browser = (function(_super) { | ||
this.format = __bind(this.format, this); | ||
this._transform = __bind(this._transform, this); _ref = Browser.__super__.constructor.apply(this, arguments); | ||
this._transform = __bind(this._transform, this); | ||
_ref = Browser.__super__.constructor.apply(this, arguments); | ||
return _ref; | ||
@@ -61,3 +63,2 @@ } | ||
var args, entry, err, message, _err; | ||
entry = chunk.toString(); | ||
@@ -83,3 +84,2 @@ if (entry[0] === '{') { | ||
var args, config, result; | ||
config = this.getConfig(); | ||
@@ -89,3 +89,2 @@ args = []; | ||
var key, matchedStyle, style, _ref1; | ||
if (config.color === false) { | ||
@@ -119,3 +118,12 @@ return message; | ||
module.exports = { | ||
Browser: Browser | ||
Browser: Browser, | ||
createBrowser: 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; | ||
})(Browser, args, function(){}); | ||
} | ||
}; |
116
package.json
{ | ||
"name": "caterpillar-browser", | ||
"version": "2.0.0", | ||
"description": "Use Caterpillar within Web Browsers! (even includes support for colors!)", | ||
"homepage": "https://github.com/bevry/caterpillar-browser", | ||
"keywords": [ | ||
"caterpillar", "caterpillar-transform", | ||
"console", "log", "logger", "logging", "debug", | ||
"stream", "transform", | ||
"browser", "console.log" | ||
], | ||
"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-browser/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "http://github.com/bevry/caterpillar-browser.git" | ||
}, | ||
"engines": { | ||
"node": ">=0.8" | ||
}, | ||
"dependencies": {}, | ||
"peerDependencies": { | ||
"caterpillar": "2.x", | ||
"caterpillar-human": "2.x" | ||
}, | ||
"devDependencies": { | ||
"readable-stream": "~1.0.2", | ||
"caterpillar": "2.x", | ||
"caterpillar-filter": "2.x", | ||
"caterpillar-human": "2.x", | ||
"coffee-script": "~1.6.2", | ||
"joe": "~1.2.0", | ||
"joe-reporter-console": "~1.2.1", | ||
"chai": "~1.6.0" | ||
}, | ||
"directories": { | ||
"lib": "./out/lib" | ||
}, | ||
"scripts": { | ||
"test": "node ./out/test/caterpillar-browser-test.js" | ||
}, | ||
"main": "./out/lib/caterpillar-browser.js" | ||
"title": "Browser Transform for [Caterpillar](https://github.com/bevry/caterpillar)", | ||
"name": "caterpillar-browser", | ||
"version": "2.0.1", | ||
"description": "Use [Caterpillar](https://github.com/bevry/caterpillar) within Web Browsers! (even includes support for colors!)", | ||
"homepage": "https://github.com/bevry/caterpillar-browser", | ||
"keywords": [ | ||
"caterpillar", | ||
"caterpillar-transform", | ||
"console", | ||
"log", | ||
"logger", | ||
"logging", | ||
"debug", | ||
"stream", | ||
"transform", | ||
"browser", | ||
"console.log" | ||
], | ||
"author": "2013+ 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-browser/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "http://github.com/bevry/caterpillar-browser.git" | ||
}, | ||
"engines": { | ||
"node": ">=0.8" | ||
}, | ||
"dependencies": {}, | ||
"peerDependencies": { | ||
"caterpillar": "2.x", | ||
"caterpillar-human": "2.x" | ||
}, | ||
"devDependencies": { | ||
"readable-stream": "~1.1.9", | ||
"caterpillar": "2.x", | ||
"caterpillar-filter": "2.x", | ||
"caterpillar-human": "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-browser-test.js" | ||
}, | ||
"main": "./out/lib/caterpillar-browser.js", | ||
"badges": { | ||
"travis": true, | ||
"npm": true, | ||
"gittip": "bevry", | ||
"flattr": "344188/balupton-on-Flattr", | ||
"paypal": "QB8GQPZAH84N6" | ||
}, | ||
"license": { | ||
"type": "MIT" | ||
} | ||
} |
@@ -0,24 +1,42 @@ | ||
<!-- TITLE/ --> | ||
# Browser Transform for [Caterpillar](https://github.com/bevry/caterpillar) | ||
[![Build Status](https://secure.travis-ci.org/bevry/caterpillar-browser.png?branch=master)](http://travis-ci.org/bevry/caterpillar-browser) | ||
[![NPM version](https://badge.fury.io/js/caterpillar-browser.png)](https://npmjs.org/package/caterpillar-browser) | ||
[![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-browser.png?branch=master)](http://travis-ci.org/bevry/caterpillar-browser "Check this project's build status on TravisCI") | ||
[![NPM version](https://badge.fury.io/js/caterpillar-browser.png)](https://npmjs.org/package/caterpillar-browser "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/ --> | ||
Use [Caterpillar](https://github.com/bevry/caterpillar) within Web Browsers! (even includes support for colors!) | ||
<!-- /DESCRIPTION --> | ||
<!-- INSTALL/ --> | ||
## Install | ||
### Backend | ||
### [Node](http://nodejs.org/), [Browserify](http://browserify.org/) | ||
- Use: `require('caterpillar-browser')` | ||
- Install: `npm install --save caterpillar-browser` | ||
1. [Install Node.js](http://bevry.me/node/install) | ||
2. `npm install --save caterpillar-browser` | ||
### [Ender](http://ender.jit.su/) | ||
- Use: `require('caterpillar-browser')` | ||
- Install: `ender add caterpillar-browser` | ||
### Frontend | ||
<!-- /INSTALL --> | ||
1. [See Browserify](http://browserify.org/) | ||
## Usage | ||
@@ -33,12 +51,12 @@ | ||
// Logger | ||
var logger = new (require('caterpillar').Logger)({level:7}); | ||
var logger = require('caterpillar').createLogger({level:7}); | ||
var output = logger | ||
.pipe( | ||
new (require('caterpillar-filter').Filter)() | ||
require('caterpillar-filter').createFilter() | ||
) | ||
.pipe( | ||
new (require('caterpillar-human').Human)() | ||
require('caterpillar-human').createHuman() | ||
) | ||
.pipe( | ||
new (require('caterpillar-browser').Browser)() | ||
require('caterpillar-browser').createBrowser() | ||
); | ||
@@ -132,10 +150,49 @@ | ||
<!-- HISTORY/ --> | ||
## History | ||
You can discover the history inside the [History.md](https://github.com/bevry/caterpillar-browser/blob/master/History.md#files) file | ||
[Discover the change history by heading on over to the `History.md` file.](https://github.com/bevry/caterpillar-browser/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-browser/commits?author=balupton) | ||
[Become a contributor!](https://github.com/bevry/caterpillar-browser/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 © 2013+ [Bevry Pty Ltd](http://bevry.me) | ||
Licensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT license](http://creativecommons.org/licenses/MIT/) | ||
Copyright © 2013+ Bevry Pty Ltd <us@bevry.me> (http://bevry.me) | ||
<!-- /LICENSE --> | ||
12419
143
197