Giter Site home page Giter Site logo

Comments (3)

jekru avatar jekru commented on September 24, 2024

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

from wikifolio.

henrydatei avatar henrydatei commented on September 24, 2024

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)

from wikifolio.

jekru avatar jekru commented on September 24, 2024

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.

from wikifolio.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.