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 🙏

© 2026 – Pkg Stats / Ryan Hefner

easy-dialog

v1.0.4

Published

the easy dialog

Downloads

14

Readme

简单介绍

使用es6开发,提供了6种功能弹窗,接下来会对每一个的使用具体分析。

基本使用

可以直接通过标签引入,也可以使用npm,支持import

npm i easy-dialog
import easyDialog from 'easy-dialog'

或者
<script src="../lib/index.js"></script>

declare

一些使用帮助或者使用许可的显示

easyDialog.declare({bar: "使用许可", content: txt}, [{'yes': '确认'}], function (type, input, c) {
    if (type == 'yes') {
        easyDialog.toast('完成', 3000, function () {
            console.log(c)
        })
        this.hide();
    }
})

imgad

用于进入首页的弹窗图片信息显示,输入一个图片静态资源的路径。

easyDialog.imgad('http://oankigr4l.bkt.clouddn.com/201804301921_288.png', function () {
    this.hide();
})

prompt

一个弹窗输入框,也可以扩展成登录框,添加了输入信息的验证,可以扩展参数输入匹配的正则表达式。

easyDialog.prompt({bar: "请输入小组名", content: '深圳分组'}, null, function (type, input, c) {
    if (type == 'yes') {
        easyDialog.toast(input, 3000, function () {
            console.log(c)
        })
        this.hide();
    }
})

toast

最普通的toast,样式很简单,输入毫秒时间。

easyDialog.toast('我是不好看的弹窗', 3000, function () {
    console.log('toast隐藏')
})

alert

用户提醒,只有一个按钮。

easyDialog.alert('你确定?', true, function () {
    console.log('确定了')
})

confirm

用户确认框,有两个按钮,按钮上显示的文字可以自定义传入。

easyDialog.confirm('你可以不确定的!', null, function (type) {
    easyDialog.toast('您点击了' + type, 2000);
    this.hide();
})

总结

组件在主要针对手机端,pc端未进行兼容。

最后的惯例,贴上我的博客,欢迎关注