console-polyfill
Advanced tools
Comparing version 0.2.2 to 0.2.3
15
index.js
@@ -6,16 +6,15 @@ // Console-polyfill. MIT license. | ||
'use strict'; | ||
global.console = global.console || {}; | ||
if (!global.console) { | ||
global.console = {}; | ||
} | ||
var con = global.console; | ||
var prop, method; | ||
var empty = {}; | ||
var dummy = function() {}; | ||
var properties = 'memory'.split(','); | ||
var properties = ['memory']; | ||
var methods = ('assert,clear,count,debug,dir,dirxml,error,exception,group,' + | ||
'groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,' + | ||
'show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn').split(','); | ||
while (prop = properties.pop()) if (!con[prop]) con[prop] = empty; | ||
while (method = methods.pop()) if (!con[method]) con[method] = dummy; | ||
while (prop = properties.pop()) if (!con[prop]) con[prop] = {}; | ||
while (method = methods.pop()) if (typeof con[method] !== 'function') con[method] = dummy; | ||
// Using `this` for web workers & supports Browserify / Webpack. | ||
})(typeof window === 'undefined' ? this : window); | ||
// Using `this` for web workers while maintaining compatibility with browser | ||
// targeted script loaders such as Browserify or Webpack where the only way to | ||
// get to the global object is via `window`. |
{ | ||
"name": "console-polyfill", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "Browser console polyfill. Makes it safe to do console.log()-s etc always.", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"files": ["index.js"], | ||
"repository": { | ||
@@ -10,0 +8,0 @@ "type": "git", |
# console-polyfill | ||
Browser console polyfill. Makes it safe to do console.log()-s etc always. | ||
Browser console polyfill. Makes it safe to do `console.log()`-s etc always. | ||
## Installation | ||
* Just include console-polyfill before your scripts. | ||
* `component install paulmillr/console-polyfill` if you’re using [component(1)](https://github.com/component/component). | ||
* `bower install console-polyfill` if you’re using [Twitter Bower](http://bower.io). | ||
## Usage | ||
* `npm install --save console-polyfill`; `require('console-polyfill')` | ||
* Or, just include console-polyfill before your scripts. | ||
* Or, do `bower install console-polyfill` if you’re using [Bower](http://bower.io). | ||
## License | ||
The MIT License (MIT) | ||
Copyright (c) 2013 Paul Miller (http://paulmillr.com/) | ||
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. | ||
[MIT](https://github.com/paulmillr/mit) (c) 2016 Paul Miller (http://paulmillr.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
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
2
1629
3
19
13