JavaScript object viewer, useful for building debugging tool.
https://luna.liriliri.io/?path=/story/object-viewer
Add the following script and style to your page.
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/luna-object-viewer/luna-object-viewer.css" />
<script src="//cdn.jsdelivr.net/npm/luna-object-viewer/luna-object-viewer.js"></script>
You can also get it on npm.
npm install luna-object-viewer --save
import 'luna-object-viewer/luna-object-viewer.css'
import LunaObjectViewer from 'luna-object-viewer'
const container = document.getElementById('container')
const objectViewer = new LunaObjectViewer(container, {
unenumerable: false,
accessGetter: true,
})
objectViewer.set(window.navigator)
- accessGetter(boolean): Access getter value.
- object(any): JavaScript object to display.
- prototype(boolean): Show prototype.
- unenumerable(boolean): Show unenumerable properties.
Set the JavaScript object to display.