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

memory-seek-api

v0.9.1

Published

Memory Seek API client for TypeScript

Readme

memory-seek-api

Memory Seek TypeScript API 客户端。纯函数,零框架依赖,与 memory-seek-backend 对齐。

安装

# monorepo workspace
pnpm add memory-seek-api

# 或 file 协议
pnpm add file:../memory-seek-api/memory-seek-api-ts

快速开始

import { initApiConfig, auth, user, visual } from 'memory-seek-api'

// 1. 初始化
initApiConfig({ baseUrl: '/api' })

// 2. 登录
const { data } = await auth.login({ account: 'admin', password: '123456' })

// 3. 获取用户信息
const me = await user.getMe()

// 4. 获取影像瀑布流
const visuals = await visual.getVisuals({ size: 20 })

// 5. 收藏夹
const collections = await visual.collection.getCollectionList()

// 6. 评论
const comments = await visual.comment.getCommentList(visualId)

// 7. 时间线
const stats = await visual.timeline.getMonthlyStats()

存储适配器

默认使用 localStorage,可注入自定义适配器:

import { setStorageAdapter } from 'memory-seek-api'

// 内存存储 (SSR / 测试)
setStorageAdapter(new Map() as any)

// React Native
import AsyncStorage from '@react-native-async-storage/async-storage'
setStorageAdapter({
  getItem: (k) => AsyncStorage.getItem(k),
  setItem: (k, v) => AsyncStorage.setItem(k, v),
  removeItem: (k) => AsyncStorage.removeItem(k),
})

消息处理器

注入自定义 UI 反馈:

import { setMessageHandler } from 'memory-seek-api'
import { ElMessage } from 'element-plus'

setMessageHandler({
  error: (msg) => ElMessage.error(msg),
  success: (msg) => ElMessage.success(msg),
})

API 模块

| 模块 | 说明 | |------|------| | auth | 登录、注册、邮箱验证码、刷新令牌 | | user | 用户信息、头像、密码、邀请码 | | visual | 影像上传、瀑布流、详情、批量删除、哈希校验 | | visual.collection | 收藏夹 CRUD、批量添加/移除影像 | | visual.comment | 评论发布、删除、点赞/取消点赞 | | visual.timeline | 时间线统计 | | visual.like | 影像点赞/取消点赞、点赞列表 | | visual.face / visual.person | 人脸与人物 | | audit | 行为审计(管理端):行为量统计、热门排行、审计流水 |

构建

pnpm build    # ESM + CJS
pnpm dev      # 监听模式