Skip to content

wiktionary-parser/wiktionary-json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wiktionary-json

Parse a wiktionary article to JSON

Installation

npm i wiktionary-json

Usage

const wiktionaryJson = require('wiktionary-json')

// parse content from a full wiktionary page HTML
const content = wiktionaryJson('<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":[...]
    }
  ]
}]

Releases

No releases published

Packages

No packages published