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

@qian-kun/api

v0.1.1

Published

QK Shell 应用开发 SDK,提供 TypeScript 类型和 API 代理。

Downloads

19

Readme

@qian-kun/api

QK Shell 应用开发 SDK,提供 TypeScript 类型和 API 代理。

安装

在 QK 应用项目中:

npm install @qian-kun/api

或在 create-qk-app 脚手架中已预装。

使用

import { clipboard, fs, store, crypto, shell } from '@qian-kun/api'

// 剪贴板
await clipboard.writeText('hello')
const text = await clipboard.readText()

// 文件系统
const content = await fs.readFile('/path/to/file')
await fs.writeFile('/path/to/file', 'content')
const files = await fs.readDir('/path/to/dir')
const path = await fs.dialogOpen()

// 持久化存储(按 app id 自动隔离)
await store.set('key', 'value')
const val = await store.get('key')
await store.remove('key')

// 加密
const hash = await crypto.hash('sha256', 'hello')

// 命令执行
const result = await shell.execute('echo hello')
console.log(result.stdout)

Mock 模式

开发时在浏览器中独立调试,@qian-kun/api 自动切换为 mock 实现。在 vite.config.ts 中配置 alias:

export default defineConfig({
  resolve: {
    alias: {
      '@qian-kun/api/mock': '@qian-kun/api/src/mock',
      '@qian-kun/api/runtime': '@qian-kun/api/src/runtime',
    },
  },
})

Mock 模式下所有 API 调用会在 console 中输出 [@qian-kun/api mock] 提示,不会实际执行操作。

权限

API 可用性取决于应用 manifest.json 中声明的 permissions。未声明的 API 域不存在,调用会抛出错误。

{
  "permissions": ["clipboard", "fs", "store"]
}

可用权限:fs、clipboard、shell、store、crypto