dijs / wiki

Wikipedia Interface for Node.js
MIT License
313 stars 62 forks source link

Add option to get sections and section content for a page #119

Closed sarangjo closed 5 years ago

sarangjo commented 5 years ago

This is an important functionality for my use-case, so it would be good to add the ability to retrieve more detailed information about the page.

dijs commented 5 years ago

This has already been implemented. Sorry if it was not documented well, I will update the docs.

wiki()
    .page('Batman')
    .then(page => page.content())
    .then(content => JSON.stringify(content, null, 3))
    .then(console.log);
sarangjo commented 5 years ago

Ah, my apologies. Thanks for the prompt reply!