2.0.0 • Published 2 years ago

cheerio-create-text-node v2.0.0

Weekly downloads
17
License
ISC
Repository
github
Last release
2 years ago

cheerio-create-text-node

Add .createTextNode(text) functionality to cheerio

demo

import * as cheerio from 'cheerio';
import * as cheerioCreateTextNode from 'cheerio-create-text-node';

$ = cheerio.load('<ul>  <li></li>  </ul>');
cheerioCreateTextNode.use($);

append

let text = $.createTextNode(123);
$('ul').append(text);

appendTo

let text = $.createTextNode(123);
text.appendTo($('ul'));