Skip to content

limelock/limelock-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

})();

About

Limelock library for Node JS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published