npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

screen-console

v1.0.9

Published

Use for the device, which can't offer the console.I am at work, often on television for development, but the TV on the browser without a console.No console, led to the development of debugging bug is the biggest challenge.This time you need to write a con

Downloads

5

Readme

screen-console

Use for the device, which can't offer the console.I am at work, often on television for development, but the TV on the browser without a console.No console, led to the development of debugging bug is the biggest challenge.This time you need to write a console, the browser directly shows the results we want to print, or even V8 engine reported the wrong.So I wrote this plugin to implement this feature.

screen-console

How to import

You can download the zip file via github and introduce ./dist/js/index.js in HTML. As follows:

<script type="text/javascript" src="./js/index.js"></script>

You can also download it through the node package manager, npm, and import it in JavaScript files. As follows:

cnpm i screen-console

After the installation is complete, you can import JavaScript files. As follows:

import ScreenConsole from 'screen-console';

In this way, the plugin can be used.

How to use


// Create an instance.
// There is a default options,you can change the color, show, and scroll.


window.screenConsole = new ScreenConsole();
// Init the instance.
window.screenConsole = new ScreenConsole({
		logColor: 'lightgreen',
        infoColor: 'yellow',
        warnColor: 'white',
        errorColor: 'red',
        isShow: true,
        isScrollToBack: true
});
// You can use the extendsExports api to do something like add exports when you want to log.
// But you should remenber don't use the console[xxx] at all.
screenConsole.extendsExports(()=>{
    alert('hello');
});

// You can use the all functions of window.console and now you can use the arguments. 
screenConsole.log(1);
screenConsole.error(1);
screenConsole.info(1);
screenConsole.warn(1);

/**
 * @description 代理按键组合
 * @author USHOW JACK, EMAIL: [email protected].
 * @param {any} callback 
 */

/**
 * @description 
 * @author USHOW JACK, EMAIL: [email protected].
 * @param {any} string 格式 keydown/'a+b+c+d' or click/5
 */
/**
 * @description 
 * @author USHOW JACK, EMAIL: [email protected].
 * @param {any} type 'click'/'keydown' default is keydown.
 */

window.a = screenConsole.proxyPress('keydown','49+49', () => {
    // Make the console show.
    screenConsole.consoleShow();
});
window.b = screenConsole.proxyPress('keydown','50+50', () => {
    // Make the console hide.    
    screenConsole.consoleHide();
});
window.c = screenConsole.proxyPress('click',2, () => {
    // Make the console clear.
    screenConsole.clear();
});
// And you also can remove the event.
window.a.removeEvent();
window.b.removeEvent();
window.c.removeEvent();

// Finally, you must know that the instance can only be instantiated once.But you can remove the DOM, through the destroy function.
screenConsole.destroy();

APIs


init(options);
consoleShow();
consoleHide();

log(msg);
warn(msg);
error(msg);
info();

scrollToggle();
clear(msg);
destroy();

extendsExports(callback);

// Proxy the keydown or click events.
// And return a instance of the events,you can use removeEvent to remove
proxyPress(type, rule, callback);
instantOfProxyPress.removeEvent();