JS library which helps to get some site table converted to json
⚠️ NOTE: this library may work unstable, so please create an issue if you encounter an error
with NPM
npm install getjsontable
with YARN
yarn add getjsontable
import table from "getjsontable";
table("https://sa-mp.ru/adminhistory-aurum", "post", undefined, {
hideColumnsDescription: true,
})
.then((res) => console.log(res[0]))
.catch((err) => {
console.log(err);
console.log(`this is an error`);
});
But it will be better if you will use ES modules
const table = require("getjsontable").default;
table("https://sa-mp.ru/adminhistory-aurum", "post", undefined, {
hideColumnsDescription: true,
})
.then((res) => console.log(res[0]))
.catch((err) => {
console.log(err);
console.log(`this is an error`);
});
Option | Type |
---|---|
url | string |
method | string |
axiosOptions (options of http request) |
AxiosRequestConfig<any,any> (docs reference)
|
options | IOptions |
Option | Explanation |
---|---|
hideColumnsDescription (boolean) |
Hide the columns explanation |
[
{'0': <first column data of first row>, '1': <second column data of first row>, .... }
]