0.0.2 • Published 6 years ago

limelock v0.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

limelock-node

npm

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!');

})();