New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

collect-console

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

collect-console

A library for intercepting uses of console.log

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
6
200%
Maintainers
1
Weekly downloads
 
Created
Source

collect-console

A utility library for collecting usages of console.

Usage

const collect = require('collect-console')

// usage with resetter
const reset = collect.log()
console.log('hello')
console.log(',', 'world')
reset() // returns ['hello', ', world']

// sync usage that automatically resets
collect.warn(() => {
    console.warn('warning')
    console.warn(',', 'world')
}) // returns ['warning', ', world']

// async usage that automatically resets
collect.error(() => {
    console.error('argh')
    console.error(',', 'world')
    return Promise.resolve()
}).then(...) // resolves to ['argh', ', world']

Keywords

console

FAQs

Package last updated on 19 Jun 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts