@a-2-c-2-anpm/sint-sequi-beatae

1.0.0 • Public • Published

@a-2-c-2-anpm/sint-sequi-beatae

A Node.js wrapper for the Backpack.tf economy Web API.

npm version node version npm test dependencies npm downloads license paypal

Installation

Using npm:

$ npm install @a-2-c-2-anpm/sint-sequi-beatae

Using yarn:

$ yarn add @a-2-c-2-anpm/sint-sequi-beatae

Testing

Note: Make sure you've supplied a valid API key in the test.js file.

Using npm:

$ npm test

Using yarn:

$ yarn test

Examples

Importing with CommonJS

const bptfprices = require('@a-2-c-2-anpm/sint-sequi-beatae');

or with ES6's import statement

import bptfprices from '@a-2-c-2-anpm/sint-sequi-beatae';

Instantiating with the apiKey option

const bptf = new bptfprices({ apiKey: 'XXXXXXXXXXXXXXXXXXXXXXXX' });

Asynchronous requests with callbacks

bptf.getSpecialItems({
    appid: 440,
    callback: (err, specials) => {
        if (err) throw err;

        console.log(specials.items);
    }
});

Asynchronous requests with async/await

(async () => {
    try {
        const data = await bptf.getCurrencies({ 
            raw: 2 
        });

        console.log(data.currencies);
    } catch (error) {
        console.error('An error occurred: ', error);
    }
})();

There are some more examples available in the test directory.

Documentation

See the Wiki pages for further documentation.

License

MIT

Copyright 2023, Simon Sørensen

Package Sidebar

Install

npm i @a-2-c-2-anpm/sint-sequi-beatae

Weekly Downloads

3

Version

1.0.0

License

MIT

Unpacked Size

11.9 kB

Total Files

8

Last publish

Collaborators

  • tranduc345zz