# wiki-page

> A lightweight module used for fetching content and data from Wikipedia using the Wikipedia REST API

Latest version **1.0.0** (published 2019-05-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install wiki-page
pnpm add wiki-page
yarn add wiki-page
bun add wiki-page
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-05-11 |
| First published | 2019-05-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 6.6 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Waltir |
| Maintainers | waltir |
| Keywords | wiki, wikipedia, rest, api, post, data |

## Links

- npm: https://www.npmjs.com/package/wiki-page
- Repository: https://github.com/waltir/wiki-page
- Homepage: https://github.com/waltir/wiki-page#readme
- Issues: https://github.com/waltir/wiki-page/issues
- npm.io page: https://npm.io/package/wiki-page

## Dependencies (2)

- [qs](https://npm.io/package/qs.md) ^6.7.0
- [request](https://npm.io/package/request.md) ^2.88.0

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2019-05-11

## README

# Wiki-Page
### A straightforward and lightweight Node.js module for accessing Wikimedia content using the [Wikipedia REST API](https://en.wikipedia.org/api/rest_v1/#/Page%20content)



### Install using the node.js package manager npm:
`$ npm install wiki-page`



## Examples: 
* Demos of the module are located in: [./test](test.js)
* Also, the [Wikipedia REST API documentation](https://en.wikipedia.org/api/rest_v1/#/Page%20content) contains some working examples



# Usage
## Require Module and Initialize Client
`var wiki = require('wiki-page');`



## Wiki fetch - [EXAMPLES](test.js)
`wiki.get({params}, callback)`
```
wiki.fetch({
    section: 'page',
    type: 'summary',
    title: 'orlando fl',
    }, (data) => {
    console.log(data);
});
```

## params {Object} Documentation - Please see the [Wikipedia REST API](https://en.wikipedia.org/api/rest_v1/#/Page%20content) for full list of endpoints
* `section`: The section type in the [Wikipedia REST API](https://en.wikipedia.org/api/rest_v1/#/Page%20content) - `'page', 'data', 'feed', 'transform', etc.`
* `type`: The content type - `'pdf', 'title', 'summary', 'html', 'media', 'metadata', 'references', 'mobile-html', 'related', 'random', 'pdf', 'data-parsoid', 'lint', 'onthisday', 'segments'`
* `title`: The subject of the returned content - `'calico cat', 'german shepard' or 'ford falcon'`
* `event`: For use in endpoints that require and event type - `'births', 'all', 'selected', 'deaths', 'events', 'holidays'`
* `revision`: For use in endpoints that require a revision number - `'3606853'`
* `date`: For use in endpoints that require a date - `'06/11' or '2012/05/12'`
* `format`: For use in endpoints that require a format - `'title', 'html', 'summary', 'related', 'mobile-sections', 'mobile-sections-lead'`



## Alternatively you can use the complete endpoint provided in the [Wikipedia REST API](https://en.wikipedia.org/api/rest_v1/#/Page%20content) - [EXAMPLES](test.js)
`wiki.fetch({endpoint}, callback)`
```
wiki.fetch({query: '/page/summary/orlando'}, (data) => {
    console.log(data);
});
```


## Testing
Clone the repo and run the `test.js` file using `$ node test`

```
$ git clone git://github.com/waltir/wiki-page.git
$ cd wiki-page
$ npm install
$ node test
```

---
_Source: https://npm.io/package/wiki-page · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
