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

chuncai

v1.0.7

Published

A lovely Page Wizard, is responsible for selling meng.

Downloads

6

Readme

chuncai

npm Github file size

A lovely Page Wizard, is responsible for selling moe...

一个可爱的页面导航精灵,负责卖萌。

image

github: https://github.com/shalldie/chuncai

查看 demo

Installation

npm install chuncai

Usage & Example

调用 init 方法初始化。 chuncai.init(opt:IOpt)

  • words 是一个数组: Array,存放春菜闲暇时候说的话。
  • menu 是菜单: IOpt,其中:
  1. object 表示子菜单
  2. key $title 是在展开子菜单的时候,春菜要说的话
  3. string 表示点击后要说的话
  4. Function 是点击后要执行的方法

可查看如下 example 和 interface 。

// es module、typescript
import chuncai from 'chuncai';
// commonjs
//let chuncai = require('chuncai');
// window
//var chuncai = window['chuncai'];

const opt = {
    menu: {
        $title: '一级菜单的标题',
        '点击会执行方法': function () {
            alert('hello chuncai');
        },
        '点击会说出一段话': 'balabalabalabalabala......',
        '点击展开二级菜单': {
            $title: '二级菜单的标题',
            '选项1': '',
            '选项2': function() {},
            '三级菜单': {...}
        },
        '隐藏春菜': function () {
            chuncai.hide();
        }
    },
    words: [
        '咦你想做什么 oAo',
        'balabalabala...',
        ...
    ]
};

chuncai.init(opt);

Interface

/**
 * 初始化参数
 *
 * @export
 * @interface IOpt
 */
export interface IOpt {
    /**
     * 菜单
     *
     * @type {IMenuItem}
     * @memberof IOpt
     */
    menu: IMenuItem;
    /**
     * 随机语句
     *
     * @type {Array<string>}
     * @memberof IOpt
     */
    words: Array<string>;
}

/**
 * 菜单项
 *
 * @export
 * @interface IMenuItem
 */
export interface IMenuItem {
    /**
     * 展开菜单时,陈述的文字
     *
     * @type {string}
     * @memberof IMenuItem
     */
    $title?: string;

    /**
     * 点击每一项菜单时,进行的操作
     * string    - 陈述文字
     * Function  - 执行回调方法
     * ImenuItem - 子菜单
     *
     * @type {string|Function|IMenuItem}
     * @memberof IMenuItem
     */
    [prop: string]: string | Function | IMenuItem;
}

>_<#@! Enjoy.