
The Temme JavaScript library uses custom selectors to extract JSON from HTML using pure JavaScript.
How to use it:
Install the Temme library:
# Yarn $ yarn add temme # NPM $ npm install temme --save
Import the Temme library.
// ES 6
import temme from 'temme';
// CommonJS:
const temme = require('temme');Specify the selector.
const selector = 'div[color=$c]{$t};'Define the HTML.
const html = '<div color="red">hello world</div>'
Extract JSON from HTML:
temme(html, selector)
This will output a JSON array:
{ c: 'red', t: 'hello world' }Changelog:
v0.8.0 (10/29/2018)
- Update







