crypto-converter-lt

1.0.0-alpha.4 • Public • Published

NodeJS Crypto Converter

Build Status Known Vulnerabilities supported node versions codecov license: MIT Maintainability npm version npm

A minimal crypto crypto converter library for NodeJS that works out of the box.

Getting started

Installation

This package can be installed using npm

npm install crypto-converter-lt

or, yarn

yarn add crypto-converter-lt

Usage

Import crypto-converter-lt.

const CC = require('crypto-converter-lt')

Then instantiate with either the empty constructor

let cryptoConverter = new CC()

Or, with a json object

let cryptoConverter = new CC({from:"BTC", to:"ETH", amount:100})

The convert method will return the conversion based on the last conversion rate and can be used as a promise.

cryptoConverter.convert().then((response) => {
    console.log(response) //or do something else
})

convert can also take the amount as a parameter.

cryptoConverter.convert(100).then((response) => {
    console.log(response) //or do something else
})

To find the rates use the rates method.

cryptoConverter.rates().then((response) => {
    console.log(response) //or do something else
})

Chaining is also supported.

cryptoConverter.from("LTC").to("ETH").amount(125).convert().then((response) => {
    console.log(response) //or do something else
})

Issues

If any issues are found, they can be reported here.

License

This project is licensed under the MIT license.

Package Sidebar

Install

npm i crypto-converter-lt

Weekly Downloads

34

Version

1.0.0-alpha.4

License

MIT

Unpacked Size

17.7 kB

Total Files

8

Last publish

Collaborators

  • paul-shuvo