# infobox-parser

> Parse Wikipedia Infobox Source

Latest version **3.6.4** (published 2024-01-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install infobox-parser
pnpm add infobox-parser
yarn add infobox-parser
bun add infobox-parser
```

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 3.6.4 |
| Published | 2024-01-05 |
| First published | 2017-04-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/infobox-parser) |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 92.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 40 |
| Author | Richard van der Dys |
| Maintainers | dijs |

## Links

- npm: https://www.npmjs.com/package/infobox-parser
- Repository: https://github.com/dijs/infobox-parser
- Homepage: https://github.com/dijs/infobox-parser#readme
- Issues: https://github.com/dijs/infobox-parser/issues
- Funding: https://www.buymeacoffee.com/2tmRKi9
- npm.io page: https://npm.io/package/infobox-parser

## Dependencies (1)

- [camelcase](https://npm.io/package/camelcase.md) ^4.1.0

## Recent versions

- 3.6.4 (latest) — 2024-01-05
- 3.6.2 — 2021-12-27
- 3.6.1 — 2021-07-24
- 3.6.0 — 2021-04-24
- 3.5.0 — 2021-04-18
- 3.4.3 — 2021-04-17
- 3.4.2 — 2021-04-14
- 3.4.1 — 2020-05-14
- 3.4.0 — 2020-05-12
- 3.3.1 — 2019-07-15
- 3.3.0 — 2019-05-30
- 3.2.1 — 2019-05-25
- 3.2.0 — 2019-02-17
- 3.1.1 — 2019-01-06
- 3.1.0 — 2019-01-03
- … 20 more at https://npm.io/package/infobox-parser/versions

## README

[![NPM Version](https://img.shields.io/npm/v/infobox-parser.svg)](https://www.npmjs.com/package/infobox-parser)
[![Build Status](https://travis-ci.org/dijs/infobox-parser.svg)](https://travis-ci.org/dijs/infobox-parser)

<a href="https://www.buymeacoffee.com/2tmRKi9" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-yellow.png" alt="Buy Me A Coffee" height="41" width="174"></a>

## Infobox Parser

This was originally written as a companion module for `wikijs`. But it can work great on it's own as well. The main function of this module is parsing wikipedia article's infobox data. The infobox source is in wikitext format and
difficult to parse. This module analyzes it and outputs JSON for you.

### Usage

```js
var parseInfo = require("infobox-parser")

parseInfo(`
{{Infobox Batman
|name      = Bruce Wayne
|hero      = y
}}`);
// Outputs {
	general: {
		hero: true,
		name: 'Bruce Wayne'
	}
}
```

### Parsing Options

```js
/**
 * Parse Wiki Infobox Text
 * @param {string} source - Infobox source text
 * @param {Object} options - Parsing options
 * @param {boolean} [options.simplifyDataValues=true] - Only use primary data values
 * @param {boolean} [options.removeSmall=false] - Remove <small>...</small> chunks of source data
 * @param {boolean} [options.removeReferences=true] - Remove <ref>...</ref> chunks of source data
 * @returns {Object} Structured information from source text
 */
const info = parseInfo(source, options);
```

### Support

It supports many of wikipedia features, but not all yet. If there is a feature you need it to support, but it does not. Please create an issue and I will add the functionality.

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