UNPKG

tiny-essentials

Version:

Collection of small, essential scripts designed to be used across various projects. These simple utilities are crafted for speed, ease of use, and versatility.

22 lines (14 loc) 881 B
### ✨ What's New in TinyHtml? #### 🔄 Bi-directional HTML ↔️ JSON conversion * **`htmlToJson(htmlString)`** – Parses raw HTML into structured JSON. * **`jsonToNodes(json)`** – Converts structured JSON back into real DOM nodes. * **`jsonToTinyElems(json)`** – Creates TinyHtml instances directly from JSON. #### 🧠 Template processing * **`templateToJson(templateId)`** – Convert a `<template>` tag into JSON. * **`templateToNodes(templateId)`** – Get parsed DOM nodes from a `<template>`. * **`templateToTinyElems(templateId)`** – Directly convert a template to TinyHtml. --- ### 📏 Utilities * **`fetchText(url)`** – Simple and reliable text fetcher for non-HTML data. * **`getPercentage(current, max)`** – Calculates percentage value with precision. **Full Changelog**: https://github.com/JasminDreasond/Tiny-Essentials/compare/1.20.1...1.20.2