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

jquery-vartodom

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jquery-vartodom

A jQuery plugin for rendering variables to the DOM. Supports nested objects and arrays.

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

jquery-varToDOM

Description

A jQuery plugin for rendering variables to the DOM. Supports nested objects and arrays. Browser, RequireJS, and CommonJS environments are supported.

API

$.varToDOM(opt)

Render a variable to the DOM.

  • object opt - An options object
    • string|number|boolean|array|object var - The variable to be rendered
    • number indentation - (Optional) The initial indentation level. Defaults to 0.
    • number indentationPadding - (Optional) The amount of padding per indentation. Defaults to 20px.
    • number keyValPadding - (Optional) The amount of padding in between each key and value. Defaults to 10px.
    • function onComplete - (Optional) A function to be executed after the variable is rendered

Example

$('body').varToDOM({
    indentation: 1,
    indentationPadding: 50,
    keyValPadding: 30,
    var: {
        burger: {
            delicious: true,
            price: 6.59,
            ingredients: ['bun', 'beef', 'cheese', 'lettuce', 'tomato', 'onion'],
            condiments: ['ketchup', 'mayonnaise', 'mustard']
        }
    },
    onComplete: function() {
        console.log('Done!');
    }
});

Installation

Npm
npm install jquery-vartodom --save
Bower
bower install jquery-vartodom --save

Examples

Before running any of the examples, the dependencies must be downloaded:

cd examples/shared && npm install

Browser Examples

RequireJS Examples

The examples use the Tomorrow Night color palette.

Keywords

FAQs

Package last updated on 05 Apr 2015

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