wiktionary-json
TypeScript icon, indicating that this package has built-in type declarations

0.0.8 • Public • Published

wiktionary-json

Parse a wiktionary article to JSON

Installation

npm i wiktionary-json

Usage

const wiktionaryJson = require('wiktionary-json')

// download and read content from the internet
const content = wiktionaryJson.parseFromUrl('https://en.wiktionary.org/wiki/plasma')

// or parse content from already downloaded wiktionary page/html
const content = wiktionaryJson.parserFromHTML('<html>...')

Parsed result structure

[{
  "headingLevel":1,
  "title":"plasma",
  "children":[
    {
        "headingLevel":2,
        "title":"English",
        "children":[
          {
              "headingLevel":3,
              "title":"Pronunciation",
              "children":[...]
          }
        ]
    },
    {
        "headingLevel":2,
        "title":"Estonian[edit]",
        "children":[...]
    }
  ]
}]

Readme

Keywords

none

Package Sidebar

Install

npm i wiktionary-json

Weekly Downloads

2

Version

0.0.8

License

ISC

Unpacked Size

28 kB

Total Files

24

Last publish

Collaborators

  • leonardiwagner