1.0.0 • Published 1 year ago
@a-2-c-2-anpm/sint-sequi-beatae v1.0.0
@a-2-c-2-anpm/sint-sequi-beatae
A Node.js wrapper for the Backpack.tf economy Web API.
Installation
Using npm:
$ npm install @a-2-c-2-anpm/sint-sequi-beataeUsing yarn:
$ yarn add @a-2-c-2-anpm/sint-sequi-beataeTesting
Note: Make sure you've supplied a valid API key in the test.js file.
Using npm:
$ npm testUsing yarn:
$ yarn testExamples
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
Copyright 2023, Simon Sørensen
1.0.0
1 year ago