limelock
v0.0.2
Published
Limelock data storage and integrity library for Node JS
Downloads
3
Maintainers
Readme
limelock-node
Limelock library for Node JS
Installation
npm i limelock
Usage
var Limelock = require('limelock');
(async () => {
var limelock = new Limelock();
// login
await limelock.login('<email>', '<password>');
// get account information
console.log(await limelock.me());
// put some data
var data = `Hello world! The current time is ${new Date().toLocaleString()}`;
var putRecord = await limelock.put(data, `${new Date().getTime()}.txt`);
console.log(putRecord);
// small delay to allow data to propagate through network
await delay(1000);
// get the data
var getRecord = await limelock.get(putRecord.txId);
console.log(getRecord);
var result = Buffer.from(getRecord.data, 'hex').toString();
console.log(result);
console.log(data == result ? 'Data verified!' : 'Data error!');
})();