New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@burger-editor/frozen-patty

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@burger-editor/frozen-patty

Pure HTML to JSON converter that not use template engine.

  • 0.11.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8
decreased by-20%
Maintainers
1
Weekly downloads
 
Created
Source

frozen-patty

npm version Build Status Coverage Status

Pure HTML to JSON converter that not use template engine.

Install

$ npm install -D @burger-editor/frozen-patty

Usage

Extraction

import FrozenPatty from 'frozen-patty';

FrozenPatty('<div data-field="text">value</div>').toJSON(); // => { text: 'value' }
FrozenPatty('<div data-field="field-name">value</div>').toJSON(); // => { 'field-name': 'value' }
FrozenPatty('<a href="http://localhost" data-field="href:href">link</a>').toJSON(); // => { 'href': 'http://localhost' }

FrozenPatty('<div data-bge="text">value</div>', { attr: 'bge' }).toJSON(); // => { text: 'value' }

Data merge

FrozenPatty('<div data-field="text">value</div>').merge({ text: 'merged' }).toHTML(); // => "<div data-field="text">merged</div>";

API

FrozenPatty (html[, options])

Extraction data from HTML.

arguments
argstyperequireddescriptions
htmlstringrequiredOriginal HTML
optionsObjectoptional
options†
optionstypedefaultdescriptions
attrstring"field"Data attribute name for specifying the node that FrozenPatty treats as a field

merge (data)

Data merge

argstyperequireddescriptions
dataObjectrequiredNew data

toJSON

Data to plain Object.

toHTML

Render to HTML as string.

FAQs

Package last updated on 17 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc