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

@wintelsui/secure-input

v1.0.0

Published

Secure input component for Vue2 and Vue3

Readme

SecureInput(支持 Vue3.x / Vue2.x)

SecureInput 是一个安全输入组件,只允许输入数字和英文字母。
显示规则:前两位和后两位明文,中间位使用 * 掩码。

示例:

  • 输入 123456 显示 12**56
  • 输入 1234567 显示 12***67
  • 输入 12345678 显示 12****78

demo

组件支持实时更新、光标自由移动、任意位置删除和粘贴(自动过滤非法字符)。

功能特性

  • 仅允许 0-9、a-z、A-Z
  • 掩码实时更新(长度与真实值一致)
  • 支持中间位置插入/删除/替换
  • 支持 maxlength 限制(按真实值长度)
  • 可选显示输入计数(displayNum)
  • 同时兼容 Vue3 / Vue2

安装

npm i secure-input

Vue3 用法

import { createApp } from "vue";
import App from "./App.vue";
import Vue3Plugin from "secure-input/vue3";

const app = createApp(App);
app.use(Vue3Plugin);
app.mount("#app");
<template>
  <SecureInput v-model="idCard" :maxlength="18" display-num />
</template>

<script setup>
import { ref } from "vue";

const idCard = ref("");
</script>

Vue2 用法

import Vue from "vue";
import App from "./App.vue";
import SecureInput from "secure-input/vue2";

Vue.use(SecureInput);

new Vue({
  render: (h) => h(App),
}).$mount("#app");
<template>
  <SecureInput v-model="idCard" :maxlength="18" display-num />
</template>

<script>
export default {
  data() {
    return {
      idCard: "",
    };
  },
};
</script>

API

Props

  • modelValue?: string Vue3 v-model
  • value?: string Vue2 兼容值
  • maxlength?: number | string 最大真实长度
  • displayNum?: boolean 是否显示右下角计数
  • encrypt?: boolean 是否启用脱敏显示,默认 true
  • revealHead?: number 前缀明文长度,默认 2
  • revealTail?: number 后缀明文长度,默认 2
  • maskChar?: string 掩码字符,默认 *
  • disabled?: boolean
  • readonly?: boolean

Events

  • update:modelValue(Vue3)
  • input
  • change
  • focus
  • blur

开发与测试

npm test

示例

已提供可直接参考的示例:

  • examples/README.md