
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
A fork of minimongo for agnostic datasources.
import MemoryDb from 'thermodb/MemoryDb';
const db = new MemoryDb();
const collection = await db.addCollection('things');
// collection === db.collections.things === db.things
const foo = await collection.upsert({ a: 'Hello' });
// -> { id: ..., a: 'Hello' }
Combines results from the local database with remote data.
import HybridDb from 'thermodb/HybridDb';
const db = new IndexedDb(localDb, remoteDb);
await db.addCollection('foo', {
// Cache find results in local db
cacheFind: true,
// Cache findOne results in local db
cacheFindOne: true,
// Return interim results from local db while waiting for remote db (see onRemoteData)
interim: true,
// Use local results if the remote find fails. Only applies if interim is false.
useLocalOnRemoteError: true,
// true to return `findOne` results if any matching result is found in the local database.
// Useful for documents that change rarely.
shortcut: false,
// Set to ms to timeout in for remote calls
timeout: 0,
// Compare function to sort upserts sent to server. (called by Array.sort()
sortUpserts: null,
// called if interim is true and remote data updates local collection
onRemoteData: null,
// called if interim is true and remote find throws an error
onRemoteError: null
});
Make a local database backed by IndexedDb:
import IndexedDb from 'thermodb/IndexedDb';
const db = new IndexedDb({
/*
Optionally define the key attribute of the documents. Will default
to KeyUtil.getField()
*/
key: null,
/*
Optionally define the KeyUtil instance to generate and manage document ids
*/
keyUtil: null,
/*
Optionally define a namespace to store data
*/
namespace: 'default',
});
// all options override db options
await db.addCollection('foo', options);
Make an in-memory local database backed by a simple JavaScript object.
import MemoryDb from 'thermodb/MemoryDb';
const db = new MemoryDb({
/*
Optionally define the key attribute of the documents. Will default
to KeyUtil.getField()
*/
key: null,
/*
Optionally define the KeyUtil instance to generate and manage document ids
*/
keyUtil: null,
/*
Optionally define the strategy when returning documents:
- "clone" (default) will deep clone the document before returning it
- "freeze" will prevent any modification of the returned document
*/
safety: "clone",
});
// all options override db options
await db.addCollection('foo', options);
Uses AJAX-JSON calls to an API to query a server-side database.
import RemoteDb from 'thermodb/RemoteDb';
const db = new RemoteDb({
/*
Optionally define the name of the client that will be passed as argument
to the API
*/
client: null,
/*
Optionally define the KeyUtil instance to generate and manage document ids
*/
keyUtil: null,
/*
The API URL to request and post data
*/
url: '',
/*
Optionally define a function provding the implementation to send data to
the API server
*/
httpClient: defaultHttpClient,
/*
Optionally define the options to pass to the httpClient function
*/
httpOptions: null,
/*
Does the API support QuickFind?
*/
useQuickFind: true,
/*
Does the API support POST request?
*/
usePostFind: true,
});
await db.addCollection('foo', {
/*
Optionally define the key attribute of the documents. Will default
to KeyUtil.getField()
*/
key: null
});
await db.addCollection(name, options);
// -> a Collection instance
await db.removeCollection(name);
// -> undefined
db.getCollectionNames();
// -> Array<String>
db.collections['foo'] === db['foo'];
// -> true
await db.foo.find(selector, options);
// -> Array<Object>
await db.foo.findOne(selector, options);
// -> Object
await db.foo.upsert(docs);
// -> Object or Array<Object>
await db.foo.remove(docKey);
// -> mixed
FAQs
Database for progressive Webapps
We found that thermodb demonstrated a not healthy version release cadence and project activity because the last version was released 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.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.