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

@auramarker/latdb

v0.3.30-beta

Published

一个基于文本的本地数据库。

Downloads

1,485

Readme

LatDB

一个基于文本的本地数据库。

API

const db = new LatDB(save_path)

Dict: 哈希表

db.dict.mydict.set('key', 1)
  • set(key, value)
  • get(key)
  • keys()
  • remove()
  • update(obj)
  • toJSON()
  • clear()

List: 列表

db.list.mylist.push('abc')
  • push(item)
  • pop()
  • lpush(item)
  • lpop()
  • rpush(item)
  • rpop()
  • extend(array)
  • lextend(array)
  • rextend(array)
  • all()
  • find(predicate)
  • filter(predicate)
  • map(predicate)
  • index(index)
  • indexOf(item)
  • clear()
  • remove()
  • slice(start, end?)
  • splice(start, delete_count, insert_items?)

Set: 集合

db.set.myset.add('abc')
  • add(value)
  • delete(value)
  • has(value)
  • all()
  • remove()

Collection

增强版的 List,用于存储复杂数据,每项记录都是一个 document,包含 _id 等字段。

db.collection.mycollection.insert({
  title: 'Title',
  content: 'Content',
})
  • insert(doc)
  • delete(_id)
  • update(_id, obj)
  • all()
  • find(predicate)
  • filter(predicate)
  • index(index)
  • count()

变更生命周期

数据库仅提供通用的变更来源、观察、删除保护和独占写入能力;同步服务标识和捕获计划由应用维护。withMutationOrigin 与 withExclusiveMutationOrigin 只接收来源和操作,只有真实存储变更才发出事件,嵌套的破坏性操作仍执行守卫。

在途写入始终计数,尚未安装观察者时独占写入和退休也必须等待已有写入完成。旧选项 track_mutation_lifecycle 已弃用,不再影响行为。已完成操作的写入租约不能被迟到回调继续使用。

未安装观察者的写入也建立可继承的存活上下文,使 loadJSON 等操作的内部写入能够在独占屏障或退休开始后完成,避免恢复操作与独占写入互相等待。完成后上下文失效,新写入仍受屏障与退休状态约束。

Collection 的内部 Dict 与元数据存储复用同一个异步上下文入口,来源和存活租约仍按运行时实例隔离。避免每条记录启用独立 AsyncLocalStorage 后,所有异步操作的传播与回收成本随记录数增长;保留独占等待、退休和迟到回调检查。