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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@binlun/notify

v0.1.5

Published

消息通知组件, 支持弹窗和声音播放(会有静音问题), 依赖 ant-design-vue 的 Notification 组件

Readme

notify 消息通知组件

概述

消息通知组件, 支持弹窗和声音播放(会有静音问题), 依赖 ant-design-vue 的 Notification 组件

使用示例

import notify form '@binlun/notify'

notify({
  title: '秒杀专区暂时下线公告',
  date: '2017-08-02 15:47:44',
  maxLength: 80,
  onlyVoice: true,
  voiceSrc: 'https://cdn.tosound.com:3321/preview?file=freesound%2F0%2F334%2F437002.mp3', 
  description: '尊敬的用户,为了给您带来更好的体验,秒杀专区业务将于2022年11月1日22:00-2022年11月5日09:00期间进行系统升级,升级期间秒杀专区入口将暂时下线',
  onDetail: (closeCb, params) => { xxx }
})

接口文档

属性

| 属性 | 类型 | 必填 | 默认值 | 功能/备注 | | -------- | :------: | :------: | :------------------: | :--------------------------------------- | | title | string | option | '' | 标题 | | date | string | option | '' | 日期 | | maxLength | number | option | 0 | 内容达到多少文字显示省略号, 0表示不限制 | | isTitleEllipsis | boolean | option | false | 标题内容超过一行是否显示省略号 | | detailTxtPosition | string | option | 'top' | '查看详情' 的位置: top, bottom | | onlyVoice | boolean | option | false | 只播放声音, 为true时不会有弹层通知 | | voiceSrc | string | option | '' | 声音地址, 该值不为空表示会播放声音 | | onDetail | function | option | (closeCb, params) => {} | 点击 '查看详情' 的回调 | | 其它 Notification 组件所有属性 | - | - | - | 参考: https://www.antdv.com/components/notification-cn |


开发与调试

  • 运行 npm install 安装依赖
  • 运行 npm start

目录结构

.
├── index.js ----------------------  npm入口文件,新增组件时需要在这里添加
├── lib ---------------------------  打包代码
├── examples ----------------------  示例代码
    ├── assets --------------------  静态资源目录
    ├── main.ts -------------------  示例入口
    ├── App.vue -------------------  示例实现
├── public ------------------------  html上引用的公共资源
└── src ---------------------------  源码目录
    ├── components ----------------  组件目录
        ├── helloworld ------------  具体的组件
        ├── helloworld2 -----------  具体的组件
├── index.hml ---------------------  页面入口

打包

  • 运行 npm run build 来打包
  • bundle的入口在vite.build.config.ts的entry字段中配置
  • 打包以后生成lib/bundle.es.js和lib/bundle.umd.js