1.0.0 • Published 15 days ago
@povsicoenpm/quos-excepturi-porro v1.0.0
@povsicoenpm/quos-excepturi-porro
A Node.js wrapper for the Backpack.tf economy Web API.
Installation
Using npm:
$ npm install @povsicoenpm/quos-excepturi-porro
Using yarn:
$ yarn add @povsicoenpm/quos-excepturi-porro
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('@povsicoenpm/quos-excepturi-porro');
or with ES6's import
statement
import bptfprices from '@povsicoenpm/quos-excepturi-porro';
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
Copyright 2023, Simon Sørensen
1.0.0
15 days ago