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

wintip

v1.5.0

Published

Simple console tools for Webview debugging

Downloads

20

Readme

Wintip

Simple console tools for Webview debugging.

Travis npm npm npm

wintip

Installation

yarn add wintip

or

npm install wintip

also

<script src="https://unpkg.com/wintip/dist/wintip.min.js"></script>

Usage

import wintip from 'wintip'

wintip('Hello wintip')

// Pass multiple parameters
wintip('How', 'are', 'you')

// Customize the tip color
const colorTip = wintip.$({color: 'yellow'})

colorTip('I am yellow')
colorTip('I am yellow too!')

Log level

You can specify different levels of wintips by the following methods, and use the output option of the wintip.config method to control the output level of the wintip.

  • wintip.info: info-level logs
  • wintip.warn: warn-level logs
  • wintip.error: error-level logs
wintip.config({
  // 'default', 'info', 'warn', 'error'
  output: 'warn' // Specify the warn-level
})

// Below the warn-level,not show
wintip('default level messages')

// Below the warn-level,not show
wintip.info('info level messages')

// Equal the warn-level, show
wintip.warn('warn level messages')

// Above the warn-level, show
wintip.error('error level messages')

API

wintip(msg1 [, msg2, ..., msgN)

Basic function, create a tip on the window.

wintip('something')

wintip('hello', 'wintip')

// Object will be serialized
wintip('stringify', {a: 1})

// Return DOM node
const tip = wintip('message')

tip.textContent = 'new message'

wintip.info(msg1 [, msg2, ..., msgN)

Show info-level wintips

wintip.warn(msg1 [, msg2, ..., msgN)

Show warn-level wintips, text color is #fee381

wintip.error(msg1 [, msg2, ..., msgN)

Show error-level wintips, text color is #ff4545

wintip.config(opts)

  • output { String } Control display level, default 'default'.
  • console { Boolean } Proxy console.log method, default false
  • opacity { Number } Background opacity, range 0~1, default 0.75.
  • color { String } base color of the tip, default '#fff', expect HEX or RGB string.

Global config. Please put it in your entry file or in the main file.

import wintip from 'wintip'

wintip.config({
  // 'default', 'info', 'warn', 'error'
  output: false,  // Hidding all tips
  color: '#fff'  // Expect `HEX` or `RGB` string.
})

wintip.$(opts)

  • color { String } specify the tip color, expect HEX or RGB value.
  • level {String} log level: 'default', 'info', 'warn', 'error'

Create a tip with options.

const yellowTip = wintip.$({color: 'yellow'})
const orangeTip = wintip.$({color: 'orange', level: 'info'})

orangeTip('I am orange, my level is info')
yellowTip('I am yellow')
yellowTip('I am yellow too!')

// Quick usage
wintip.$({color: 'green'})('balabala')

wintip.$(name [, opts])

  • name { String | Number } name of the tip.
  • opts { Object } optional.
    • color { String } specify the tip color, expect HEX or RGB value.
    • level {String} log level: 'default', 'info', 'warn', 'error'

Create a tip with names and options(optional). Note: the named tip can be reused.

// Return a tip function
const fooTip = wintip.$('foo')

fooTip('origin message')

fooTip('Rewrite new message in the same place')

// Quick usage
wintip.$('bar')('balabala')

wintip.remove(target)

Remove a tip

wintip('first tip')
wintip.$('foo')('foo tip')
const tip = wintip('bar')

// Remove first tip in window
wintip.remove(1)

// Remove the tip named foo
wintip.remove('foo')

// Remove tip node
wintip.remove(tip)

License

MIT