inspector-dom

0.1.1 • Public • Published

Inspector Dom

Pure vanilla-js ultra-lightweight dom inspector similiar to built-in tool in chrome browser with a custom callback onClick.

Install

yarn add inspector-dom

const Inspector = require('inspector-dom')

import Inspector from 'inspector-dom'

Usage

Initialize:

const inspector = Inspector()

Props:

const inspector = Inspector({
    root: 'body',                       // root element
    excluded: [],                       // excluded children, string or node Element
    outlineStyles: '2px solid orange',  // styles
    onClick: el => console.log('Element was clicked:', constructCssPath(el) //onClick callback
});

API

inspector.enable() // turn the inspector on

inspector.cancel() // turn the inspector off

Readme

Keywords

none

Package Sidebar

Install

npm i inspector-dom

Weekly Downloads

223

Version

0.1.1

License

MIT

Unpacked Size

207 kB

Total Files

10

Last publish

Collaborators

  • mbondyra