.get()

Returns the cached value of the provided key.

get(key, decrypt)

db.set('Greeting', 'Hello World'); // 'Hello World'

db.get('Greeting'); // 'Hello World'

Also allows the use of dot notation:

db.set('user', { name: 'Peter', age: 19 }); // { name: 'Peter', age: 19 }

db.get('user.name'); // 'Peter'
db.get('user.age'); // 19
db.get('user.hobbies'); // undefined

And the possibility to decrypt the data, if previously encrypted:

db.get('PASSWORD'); // d95e3df34d0a39c3177adf393e90c533:d861d25474fb4fe0c921be
db.get('PASSWORD', true); // password123

Last updated