Open henrydatei opened 2 years ago
I would recommend to use TypeScript.
npm init -y
npx tsc --init
npm install wikifolio
mkdir example.ts
import { Api } from 'wikifolio';
async function fetchPrice() {
const api = new Api({email: '', password: ''});
const wikifolio = api.wikifolio('')
const price = await wikifolio.price();
console.log(price);
}
fetchPrice();
npx ts-node example.ts
Thank you very much for your fast and working answer, but when I use instead of .price()
the .details()
method, I get another error :(
import { Api } from 'wikifolio';
async function main() {
const api = new Api({email: 'email', password: 'password'});
const wikifolio = api.wikifolio('wikifolioID')
//const price = await wikifolio.price();
//console.log(price);
const details = await wikifolio.details();
console.log(details);
}
main();
/Users/henryhaustein/Downloads/wikifolio/node_modules/wikifolio/src/models/Wikifolio.ts:411
throw new Error('Wikifolio JSON not found. This is probably a bug, please report it.')
^
Error: Wikifolio JSON not found. This is probably a bug, please report it.
at Wikifolio.<anonymous> (/Users/henryhaustein/Downloads/wikifolio/node_modules/wikifolio/src/models/Wikifolio.ts:411:13)
at step (/Users/henryhaustein/Downloads/wikifolio/node_modules/wikifolio/dist/models/Wikifolio.js:44:23)
at Object.next (/Users/henryhaustein/Downloads/wikifolio/node_modules/wikifolio/dist/models/Wikifolio.js:25:53)
at fulfilled (/Users/henryhaustein/Downloads/wikifolio/node_modules/wikifolio/dist/models/Wikifolio.js:16:58)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Thank you very much for your fast and working answer, but when I use instead of
.price()
the.details()
method, I get another error :(
throw new Error('Wikifolio JSON not found. This is probably a bug, please report it.')
See #15. Wikifolio recently released a new version, that's why some features are currently broken. I hope to find some time to fix it soon.
Hi, I'm totally new to javascript and I can't get this to run. I made a new folder and run inside this
I created a new file
index.js
with this contentBut I get the following error when running
node index
:When I add
"type": "module"
to the package.json file I get the following error