
Research
/Security News
11 Malicious NuGet Tools Pose as Game Cheats to Drop a Windows Host-Surveillance Payload
11 malicious NuGet tools pose as game cheats to deploy Windows payloads, track hosts, and use Google Sheets for telemetry and control.
@ariestools/indexed-db
Advanced tools
Base functionality used throughout XY Labs TypeScript/JavaScript libraries
Base functionality used throughout XY Labs TypeScript/JavaScript libraries
Using npm:
npm install {{name}}
Using yarn:
yarn add {{name}}
Using pnpm:
pnpm add {{name}}
Using bun:
bun add {{name}}
See the LICENSE file for license rights and limitations (LGPL-3.0-only).
### .temp-typedoc
### classes
### <a id="IndexedDbKeyValueStore"></a>IndexedDbKeyValueStore
An IndexedDB key/value store.
T extends DBSchema
S extends StoreNames<T>
KeyValueStore<StoreValue<T, S>, StoreKey<T, S>>new IndexedDbKeyValueStore<T, S>(dbName, storeName): IndexedDbKeyValueStore<T, S>;
string
S
IndexedDbKeyValueStore<T, S>
readonly dbName: string;
The name of the IndexedDB database.
readonly storeName: S;
The name of the object store within the database.
optional clear(): Promise<void>;
Removes all entries from the store.
Promise<void>
KeyValueStore.clear
delete(key): Promise<void>;
Deletes the entry with the given key.
StoreKey<T, S>
The key of the entry to delete
Promise<void>
KeyValueStore.delete
get(key): Promise<StoreValue<T, S> | undefined>;
Retrieves the value associated with the given key.
StoreKey<T, S>
The key to look up
Promise<StoreValue<T, S> | undefined>
The value, or undefined if not found
KeyValueStore.get
optional keys(): Promise<StoreKey<T, S>[]>;
Returns all keys in the store.
Promise<StoreKey<T, S>[]>
KeyValueStore.keys
set(key, value): Promise<void>;
Sets a value for the given key, creating or updating the entry.
StoreKey<T, S>
The key to set
StoreValue<T, S>
The value to store
Promise<void>
KeyValueStore.set
withDb<R>(callback): Promise<R>;
Opens the underlying IndexedDB database and passes it to the callback.
R = StoreValue<T, S>
(db) => R | Promise<R>
Function to execute with the database
Promise<R>
The result of the callback
### functions
### <a id="buildStandardIndexName"></a>buildStandardIndexName
function buildStandardIndexName(index): string;
Given an index description, this will build the index name in standard form
The index description
string
The index name in standard form
### <a id="checkDbNeedsUpgrade"></a>checkDbNeedsUpgrade
function checkDbNeedsUpgrade(
dbName,
stores,
logger?): Promise<number>;
Checks whether any store in the database needs an upgrade and returns the appropriate version number.
string
The name of the database to check
Record<string, [IndexDescription]#../interfaces/IndexDescription>
Map of store names to their expected index descriptions
Logger
Optional logger for diagnostics
Promise<number>
The version to open (current version + 1 if upgrade needed, otherwise current version)
### <a id="createStoreDuringUpgrade"></a>createStoreDuringUpgrade
function createStoreDuringUpgrade<DBTypes>(
db,
storeName,
indexes,
logger?): void;
Creates an object store with the specified indexes during a version upgrade transaction.
DBTypes extends unknown = unknown
IDBPDatabase<DBTypes>
The IndexedDB database instance (during upgrade)
StoreNames<DBTypes>
The name of the store to create
[IndexDescription]#../interfaces/IndexDescription
The index descriptions to create on the store
Logger
Optional logger for diagnostics
void
### <a id="getExistingIndexes"></a>getExistingIndexes
function getExistingIndexes<T>(
db,
storeName,
logger?): Promise<IndexDescription[] | null>;
Retrieves the existing index descriptions for a store. Accepts either a database instance or a database name.
T extends object = object
| string
| IDBPDatabase<ObjectStore<T>>
The IndexedDB database instance or database name
StoreNames<ObjectStore<T>>
The name of the store to inspect
Logger
Optional logger for diagnostics
Promise<[IndexDescription]#../interfaces/IndexDescription | null>
An array of index descriptions, or null if the store does not exist
### <a id="withDb"></a>withDb
function withDb<DBTypes, R>(
dbName,
callback,
expectedIndexes?,
logger?,
lock?): Promise<R>;
Opens an IndexedDB database, automatically upgrading if needed, and passes it to the callback. Uses a mutex to serialize access to the same database by default.
DBTypes extends unknown = unknown
R = object
string
The name of the database to open
(db) => R | Promise<R>
Function to execute with the opened database
Record<string, [IndexDescription]#../interfaces/IndexDescription>
Optional map of store names to their expected indexes (triggers upgrade check)
Logger
Optional logger for diagnostics
boolean = true
Whether to use a mutex to serialize access (defaults to true)
Promise<R>
The result of the callback
### <a id="withDbByVersion"></a>withDbByVersion
function withDbByVersion<DBTypes, R>(
dbName,
callback,
version?,
expectedIndexes?,
logger?,
lock?): Promise<R>;
Opens an IndexedDB database at a specific version, handling upgrade events, and passes it to the callback. The database is automatically closed after the callback completes.
DBTypes extends unknown = unknown
R = object
string
The name of the database to open
(db) => R | Promise<R>
Function to execute with the opened database
number
Optional specific version to open (undefined for latest)
Record<string, [IndexDescription]#../interfaces/IndexDescription>
Optional map of store names to indexes to create during upgrade
Logger
Optional logger for diagnostics
boolean = true
Whether to use a mutex to serialize access (defaults to true)
Promise<R>
The result of the callback
### <a id="withReadOnlyStore"></a>withReadOnlyStore
function withReadOnlyStore<T, R>(
db,
storeName,
callback,
logger?): Promise<R>;
Opens a read-only transaction on the specified store and passes it to the callback.
T extends object = object
R = T
IDBPDatabase<ObjectStore<T>>
The IndexedDB database instance
StoreNames<ObjectStore<T>>
The name of the object store to open
(store) => R | Promise<R>
Function to execute with the read-only store
Logger
Optional logger for diagnostics
Promise<R>
The result of the callback
### <a id="withReadWriteStore"></a>withReadWriteStore
function withReadWriteStore<T, R>(
db,
storeName,
callback,
logger?): Promise<R>;
Opens a read-write transaction on the specified store and passes it to the callback.
T extends object = object
R = T
IDBPDatabase<ObjectStore<T>>
The IndexedDB database instance
StoreNames<ObjectStore<T>>
The name of the object store to open
(store) => R | Promise<R>
Function to execute with the read-write store
Logger
Optional logger for diagnostics
Promise<R>
The result of the callback
### <a id="withStore"></a>withStore
function withStore<T, R, M>(
db,
storeName,
callback,
mode,
logger?): Promise<R>;
Opens a transaction on the specified store with the given mode and passes the store to the callback. If the store does not exist, the callback receives null.
T extends object = object
R = T
M extends "readonly" | "readwrite" = "readonly"
IDBPDatabase<ObjectStore<T>>
The IndexedDB database instance
StoreNames<ObjectStore<T>>
The name of the object store to open
(store) => R | Promise<R>
Function to execute with the store (or null if it doesn't exist)
M
The transaction mode ('readonly' or 'readwrite')
Logger
Optional logger for diagnostics
Promise<R>
The result of the callback
### interfaces
### <a id="IndexDescription"></a>IndexDescription
Description of index(es) to be created on a store
key: Record<string, IndexDirection>;
The key(s) to index
optional multiEntry?: boolean;
Is the indexed value an array
optional unique?: boolean;
If true, the index must enforce uniqueness on the key
### type-aliases
### <a id="IndexDirection"></a>IndexDirection
type IndexDirection = -1 | 1;
The index direction (1 for ascending, -1 for descending)
### <a id="ObjectStore"></a>ObjectStore
type ObjectStore<T> = Record<string, T>;
Generic IndexedDB schema type that maps store names to their value types.
T extends EmptyObject = EmptyObject
### variables
### <a id="IndexSeparator"></a>IndexSeparator
const IndexSeparator: "-" = '-';
Separator used between key names when building standard index names.
FAQs
Base functionality used throughout XY Labs TypeScript/JavaScript libraries
The npm package @ariestools/indexed-db receives a total of 429 weekly downloads. As such, @ariestools/indexed-db popularity was classified as not popular.
We found that @ariestools/indexed-db demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
11 malicious NuGet tools pose as game cheats to deploy Windows payloads, track hosts, and use Google Sheets for telemetry and control.

Research
/Security News
4 compromised asyncapi packages deliver miasma botnet loader on macOS, Linux and Windows.

Research
/Security News
A compromised jscrambler npm release added a malicious preinstall hook that runs hidden native binaries on Linux, macOS, and Windows.