Nanoprogrammed Penultimate Musicianship

    roman-numeral-api-js-sdk
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.3 • Public • Published

    roman-numeral-api-js-sdk

    The official RomanNumeralApi javascript SDK

    Installation

    yarn add roman-numeral-api-js-sdk
    // or
    npm install roman-numeral-api-js-sdk

    Sample call

    // given
    const decimalNumber = 1234;
    const romanNumber = 'MCCXXXIV';
    
    // 1. an anonymous request as a promise
    const client = new Client();
    client.toRomanNumeral(decimalNumber).then(function (returned) {
        // will log `Matches`
        console.log(returned === romanNumber ? 'Matches' : 'did not match');
    });
    
    // 2. an authenticated request as an aync/await
    const convert = async () => {
        const client = new Client('YOUR_API_KEY');
        const returned = await client.toDecimalNumber(romanNumber);
        // will log `Matches`
        console.log(returned === decimalNumber ? 'Matches' : 'did not match');
    };
    
    // 3. the kitchen sink
    const API_KEY = process.env.APIKEY || '';
    const serverUrl = 'http://some-other-instance.example';
    const axiosInstance = axios.create({
        httpAgent: 'some http agent name',
    });
    
    const client = new Client(API_KEY, serverUrl, axiosInstance);

    Keywords

    none

    Install

    npm i roman-numeral-api-js-sdk

    DownloadsWeekly Downloads

    1

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    6.5 kB

    Total Files

    5

    Last publish

    Collaborators

    • angelxmoreno