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

amx-indexeddb

v0.1.6

Published

indexedDB 本地存储

Readme

amx-indexeddb

amx 使用IndexedDB制作的基础本地数据存储,IndexedDB 数据存储空间非常大切支持各种数据类型。amx-indexeddb 使你使用 IndexedDB 技术更加方便。

支持Amx技术:

  • indexedDB - IndexedDB 是一个用于在浏览器中储存较大数据结构的 Web API, 并提供索引功能以实现高性能查找. 像其他基于 SQL 的 关系型数据库管理系统 (RDBMS) 一样, IndexedDB 是一个事务型的数据库系统. 然而, 它是使用 JavaScript 对象而非列数固定的表格来储存数据的.

github : https://github.com/SenLiangpi/amx-indexedDB

用法

安装 npm i amx-indexeddb 入口引入 与 使用

  import amxIndexedDB from 'amx-indexeddb'
  const store = {
    v: 1,//版本
    name: 'amxDataDB',//数据库名称
    dbData:{
      SCP_MTF_Alpha_1:{},//表名稱
      SCP_MTF_Alpha_4:{},
      SCP_MTF_Alpha_9:{}
    }
  }
  amxIndexedDB.install(store)

  import dataDB from 'amx-indexeddb' //引入
  let SCP_MTF_Alpha_1 = new dataDB.db('SCP_MTF_Alpha_1')//获取对应表的操作权限

API

写入 add

// key //id
// value //支持幾乎所有数据类型 (err 錯誤类型不接受)
// 0.1.4 新功能
// expiration_time //存储数据失效时间,number类型 单位毫秒;此字段非必填,不填永久有效;
SCP_MTF_Alpha_1.add({key:key,value:json,expiration_time: 1000 }).then((result) => {
  console.log('ok')
}).catch((err) => {
  console.log(err)
})
// 0.1.4 新功能
//此条数据将在 1000 毫秒后失效
SCP_MTF_Alpha_1.add({key:key,value:json,expiration_time: 1000 })
//此条数据永久有效
SCP_MTF_Alpha_1.add({key:key,value:json })

修改 update (如果修改id不存在则写入该值)

// key //id
// value //支持幾乎所有數據類型 (err 錯誤類型不接受)
// 0.1.4 新功能
// expiration_time //存储数据失效时间,number类型 单位毫秒;此字段非必填,不填永久有效;
SCP_MTF_Alpha_1.update({key:key,value:json,expiration_time: 1000 }).then((result) => {
  console.log('ok')
}).catch((err) => {
  console.log(err)
})
// 0.1.4 新功能
//此条数据将在 1000 毫秒后失效
SCP_MTF_Alpha_1.update({key:key,value:json,expiration_time: 1000 })
//此条数据永久有效
SCP_MTF_Alpha_1.update({key:key,value:json })

读取 read

// key //id
SCP_MTF_Alpha_1.read(key).then((result) => {
  console.log(result.result)
}).catch((err) => {
  console.log(err)
})

刪除 remove

// key //id
SCP_MTF_Alpha_1.remove(key).then((result) => {
  console.log('delete')
}).catch((err) => {
  console.log(err)
})

批量读取 readAll

// condition //獲取規則
// 如果獲取該表所有數據 condition 傳入 undefined
// condition 規則比較複雜 請參考 indexeddb 文檔
let condition = IDBKeyRange.upperBound(1599125733694);// 該表 id 小於 1599125733694 的所有數據
condition = undefined;//獲取該表所有數據
SCP_MTF_Alpha_1.readAll(condition).then((result) => {
  console.log(result.length)
}).catch((err) => {
  console.log(err)
})

0.1.5 新增功能 接口数据缓存 IFDataCache

import dataDB from 'amx-indexeddb'
/**
 * @description: IFDataCache,用于处理接口数据缓存
 * @param {String} key 存储使用的唯一key
 * @param {Function} inter 接口函数会传入 params 参数
 * @param {Number} expirationTime 存储数据失效时间,number类型 单位毫秒;此字段非必填,不填永久有效
 * @return {Function} params 接口参数
 */
dataDB.IFDataCache('key', inter, expirationTime)

皮皮研究所出品