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

select-tool

v1.1.3

Published

demo preview === ![](https://github.com/Chencole/select-tool/blob/master/images/preview.gif)

Readme

demo preview

使用方法

step1: install select-tool

浏览器直接引入

<script src="./js/selectTool.js"></script>

npm 包管理

used select-tool in your vue project

npm install -D select-tool

.vue file import select-tool

import selectToolInit from "select-tool"

step2:创建被初始化的html元素(.selectDashboard),包含可选的容器同时又是可以框选的范围(.selet_tool_canvas),和可被选中的容器(.selectItem)

<div class="selectDashboard">
        <div class="selet_tool_canvas">
            <div class="selectItem" customAttribute='this custom attribute' ids="1"></div>
            <div class="selectItem" customAttribute='this custom attribute' ids="2"></div>
            <div class="selectItem" customAttribute='this custom attribute' ids="3"></div>
            <div class="selectItem" customAttribute='this custom attribute' ids="4"></div>
            <div class="selectItem" customAttribute='this custom attribute' ids="5"></div>
            <div class="selectItem" customAttribute='this custom attribute' ids="6"></div>
            <div class="selectItem" customAttribute='this custom attribute' ids="7"></div>
            <div class="selectItem" customAttribute='this custom attribute' ids="8"></div>
            <div class="selectItem" customAttribute='this custom attribute' ids="9"></div>
            <div class="selectItem" customAttribute='this custom attribute' ids="10"></div>
            <div class="selectItem" customAttribute='this custom attribute' ids="11"></div>
            <div class="selectItem" customAttribute='this custom attribute' ids="12"></div>
            <div class="selectItem" customAttribute='this custom attribute' ids="13"></div>
            <div class="selectItem" customAttribute='this custom attribute' ids="14"></div>
            <div class="selectItem" customAttribute='this custom attribute' ids="15"></div>
            <div class="selectItem" customAttribute='this custom attribute' ids="16"></div>
            <div class="selectItem" customAttribute='this custom attribute' ids="17"></div>
            <div class="selectItem" customAttribute='this custom attribute' ids="18"></div>
            <div class="selectItem" customAttribute='this custom attribute' ids="19"></div>
            <div class="selectItem" customAttribute='this custom attribute' ids="20"></div>
            <div class="selectItem" customAttribute='this custom attribute' ids="21"></div>
            <div class="selectItem" customAttribute='this custom attribute' ids="22"></div>
            <div class="selectItem" customAttribute='this custom attribute' ids="23"></div>
            <div class="selectItem" customAttribute='this custom attribute' ids="24"></div>
            <div class="selectItem" customAttribute='this custom attribute' ids="25"></div>
            <div class="selectItem" customAttribute='this custom attribute' ids="26"></div>
            <div class="selectItem" customAttribute='this custom attribute' ids="27"></div>
            <div class="selectItem" customAttribute='this custom attribute' ids="28"></div>
            <div class="selectItem" customAttribute='this custom attribute' ids="29"></div>
            <div class="selectItem" customAttribute='this custom attribute' ids="30"></div>
            <div class="selectItem" customAttribute='this custom attribute' ids="31"></div>
            <div class="selectItem" customAttribute='this custom attribute' ids="32"></div>
        </div>
    </div>

step3:调用函数传入初始化参数

//vue 框架里使用需要在dom加载完后才可以调用 例如在 mounted(){ selectToolInit(初始化参数) }
selectToolInit({
        canvas:'.selectDashboard',
        initTarget:'.selet_tool_canvas',
        selectElement:'.selectItem',
        // onloadBanRightClickTarget:'.resultContent',  ban browser contentmenu if mutiple select-tool methods in page
        optionalContentmenu:{single:['修改','删除','下发课程','上架','下架'],multiple:['批量删除','批量下发课程','批量上架','批量下架']},
        customAttribute:['customAttribute'],
        crudEventCallbackSingle(handleTitle,event,selectNode){
            console.log('click select tool contentmenu==================>',handleTitle,event,selectNode)
        },
        crudEventCallbackMultiple(handleTitle,event,selectNode){
            console.log('click select tool contentmenu==================>',handleTitle,event,selectNode)
        },
        itemClick(basedata,event){
            console.log('click item==================>',basedata)
        },
        selectedEventListener(arr,selectedNode){
            console.log('selected==================>',arr,selectedNode)
        },
        batchStatus(status) {
            console.log(status)
        }
    })

canvas

initTarget

selectElement