
Security News
Software Engineering Daily Podcast: Feross on AI, Open Source, and Supply Chain Risk
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.
timeseries database on leveldb
import levelup from "levelup";
import leveldown from "leveldown";
import { Master, Category } from "konsum-db";
async function example() {
// open database
const db = await levelup(leveldown("example.db"));
const master = await Master.initialize(db);
// create category named EV
const ev = new Category("EV", master, { unit: "kWh" });
await ev.write(master.db);
// write entry
await ev.writeValue(db, Date.now(), 77.34);
}
example();
Create properties from options and default options. Already present properties (direct) are skipped. The attribute list from the class will be applied to the options and merged with the given set of properties.
class aClass {
static get attributes() {
return { with_default: { default: 77 }};
}
}
definePropertiesFromOptions(new aClass());
// equivalent to
Object.definedProperties(new aClass(),{ with_default: { value: 77 }})
object Object target objectoptions Object as passed to object constructor (optional, default {})properties Object object properties (optional, default {})Set Object attribute. The name may be a property path like 'a.b.c'.
Deliver attribute value. The name may be a property path like 'a.b.c'.
Returns any value associated with the given property name
Create json based on present options. In other words only produce key value pairs if value is defined.
object Objectinitial Object (optional, default {})skip Array<string> keys not to put in the result (optional, default [])Returns Object initial + defined values
Rename attributes. Filters out null, undefined and empty strings.
mapAttributes({a:1},{a:"a'"}) // {"a'": 1}
Returns Object keys renamed after mapping
Same as mapAttributes but with the inverse mapping. Filters out null, undefined and empty strings
Returns Object keys renamed after mapping
Base
Returns string
Writes object into database. Leaves all other entries alone.
db levelupGet detail objects.
factory Class
db levelup
options Object
Returns Iterator<factory>
Delete record from database.
db levelupPrefix of the key
Returns string
object BaseReturns String prefix for a given (master) object
Name of the type in text dump
Returns string
Additional attributes to be persisted
Get instances without owner.
db levelupprefix stringgte string lowest name (optional, default "\u0000")lte string highst name (optional, default "\uFFFF")Returns AsyncIterator<Base>
Get instances with owner.
db levelupobjectgte string lowest name (optional, default "\u0000")lte string highst name (optional, default "\uFFFF")owner ObjectReturns AsyncIterator<Base>
Get a single instance.
db levelupkey stringReturns Base
Description of the content.
Returns string
Extends Base
Value Category.
name string category namedescription stringunit string physical unitfractionalDigits number display precissionKey for a given value.
time number seconds since epochReturns string key
Write a time/value pair.
db leveluptime number seconds since epochdb leveluptime number seconds since epochGet values of the category.
db levelup
options Object
Returns Iterator<Object>
Get values of the category as ascii text stream with time and value on each line.
db levelup
options Object
Returns Readable
Get Meters of the category.
db levelup
options Object
Returns Iterator<Meter>
Get Notes of the category.
db levelup
options Object
Returns Iterator<Meter>
Get categories.
Returns AsyncIterator<Category>
Prefix of the master record
Type: string
Outdated schema version
Type: string
Schema with type + name
Type: string
Schema version for newly created databases
Prefix of the categories. Will be followed by the category name
Type: string
Prefix of the values. Will be followed by the category name
Type: string
Physical unit.
Returns string
Precission
Returns number
Extends Base
Master record. Holds schema version.
schemaVersion stringClose the underlaying database.
List Categories.
Copy all data into out stream as long time text data.
out WriteableRestore database from input stream.
input Readable data from backupInitialize database. checks/writes master record.
db levelupReturns Master
Extends Base
Meter
name string category namedescription stringunit string physical unitfractionalDigits number display precissionExtends Base
Hints placed on a category at a specific time.
timeowneroptionsFormat seconds as string left padded with '0'.
seconds number seconds since epochReturns string padded seconds
FAQs
timeseries database on leveldb
We found that konsum-db 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
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.

Security News
GitHub has revoked npm classic tokens for publishing; maintainers must migrate, but OpenJS warns OIDC trusted publishing still has risky gaps for critical projects.

Security News
Rust’s crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.