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

keyboard-link

v0.2.3

Published

keyboard-link

Readme

keyboard-link

version downloads LICENSE repo-types repo-size minzip

用途

在移动端使用,解决全屏状态下,软键盘弹出对输入框遮挡的问题。

使用 websocket 通讯,实时的将活跃输入框的值传递出去。移动端自行展示在键盘上方。

特性

  • 简单、两行代码启动
  • 支持 ES6+或 TypeScript 编写源码,编译生成生产代码
  • 多环境支持(支持浏览器原生,支持 AMD,CMD,支持 Webpack,Rollup,fis 等)

安装

通过 npm 下载安装代码

$ npm i keyboard-link

通过 yarn 下载安装代码

$ yarn add keyboard-link

通过 pnpm 下载安装代码

$ pnpm i keyboard-link

使用

说明:

| 参数 | 类型 | 说明 | | ------------------------------- | -------- | ---------------------------------------- | | host | String | ws 链接地址 | | port | Number | ws 链接端口 | | useTimer | Boolean? | 可选,默认值为 false,是否使用定时器 | | useTimer | Boolean? | 可选,默认值为 false,是否使用定时器 | | isRemoveHeaderNewlinesCharacter | Boolean? | 可选,默认值为 false,是否移除头部换行符 | | isRemoveTailNewlinesCharacter | Boolean? | 可选,默认值为 false,是否移除尾部换行符 |

esm

import keyboardLink from "keyboard-link";
new keyboardLink({ host: "ws:xxx.xxx.xxx.xxx", port: 0000 });

cjs

requirejs(
  ["node_modules/keyboard-link/dist/index.js"],
  function (keyboardLink) {
    new keyboardLink({
      host: "ws:xxx.xxx.xxx.xxx",
      port: 0000,
      useTimer: true,
    });
  }
);

直接使用

<script src="node_modules/keyboard-link/dist/index.aio.min.js"></script>
<script>
  new window.keyboardLink({
    host: "ws:xxx.xxx.xxx.xxx",
    port: 0000,
    useTimer: true,
  });
</script>

兼容性

| 类型 | 是否支持 | 说明 | | ------------------- | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | input type='text' | :heavy_check_mark: | 支持良好 | | textarea | :heavy_check_mark: | 支持良好 | | input type='number' | :x: | 由于数字键盘支持输入特殊符号,并且获取实际的值并不是实际可以操作的。而且底层也没有相关的 api 可以获取到。所以建议移除项目中的数字输入框,并使用文本输入框进行自定义校验 |

API 文档 :page_facing_up: