Socket
Book a DemoInstallSign in
Socket

@nestlab/byn-exchange

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nestlab/byn-exchange

Module for get currency exchange rates. Provider national bank of Belarus.

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

BYN exchange module

Module for get currency exchange rates. Provider national bank of Belarus.

Install

$ npm i @nestlab/byn-exchange

Configuration

@Module({
    imports: [
        BynExchangeModule.forRoot({
            useCache: true,
            cacheTtl: 24 * 3600 * 1000, // 1 day
        })
    ],
})
export class AppModule {
}

Usage


export class YourService {
    constructor(private readonly converter: BynExchangeConverter) {
    }
    
    async convert1000UsdToByn(): Promise<number> {
        this.converter.convert(Currency.USD).toByn(1000);
    }

    async convert1000BynToUsd(): Promise<number> {
        this.converter.convert(Currency.USD).fromByn(1000);
    }
}

Enjoy!

Keywords

nestjs

FAQs

Package last updated on 01 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts