0.0.3 • Published 1 year ago

eleventy-plugin-console-plus v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

eleventy-plugin-console-plus

Provides an Eleventy shortcode that Pretty Prints out your variables to HTML <pre></pre> And if you want it, your temrminal. Strings, Arrays and Objects are Supported

Installing

npm

$ npm install eleventy-plugin-console-plus

Yarn

$ yarn add eleventy-plugin-console-plus

Add to your config. Usually .eleventy.js

const { logToConsole } = require("dwkns-11ty-plugins");

module.exports = (eleventyConfig) => {
  // default options shown
  options = {
    logToHtml: true, // log to HTML
    logToTerminal: true, // log to terminal
    colorizeConsole: true, // colorize the console output
    escapeHTML: true, // escape HTML in the output
    depth: 4 // depth of object to print
	}
  eleventyConfig.addPlugin(logToConsole);
}

Usage

{{ console <value>, <"title" — optional> }}
0.0.3

1 year ago

0.0.2

1 year ago