1.5.4 • Published 5 months ago

bptf-prices v1.5.4

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

bptf-prices

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 bptf-prices

Using yarn:

$ yarn add bptf-prices

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('bptf-prices');

or with ES6's import statement

import bptfprices from 'bptf-prices';

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

1.5.4

5 months ago

1.5.3

7 months ago

1.5.2

10 months ago

1.5.1

12 months ago

1.5.0

1 year ago

1.4.0

1 year ago

1.3.8

1 year ago

1.3.7

2 years ago

1.3.6

2 years ago

1.3.5

2 years ago

1.3.4

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago