The databases
method of the IDBFactory
interface returns a list representing all the available databases, including their names and versions.
Note: This method is introduced in a draft of a specifications and browser compatibility is limited.
The method does not take in any parameters.
A promise that resolves either to an error or a list of dictionaries, each with two elements, name
and version
:
-
name
-
The database name.
-
version
-
The database version.
This method may raise a DOMException
of the following types:
const promise = indexedDB.databases()
promise.then(databases => {
console.log(databases)
})