obj2indent
Convert a JavaScript object to a string used the indentation.
indent2obj.js and interconvertible.
Install
npm
$ npm install obj2indent
bower
$ bower install obj2indent
Basic
- Download the obj2indent.min.js.
- Load it in the script tag.
Usage
var results = ; console;/*depth1 depth2 depth2 depth3depth1depth1 dpeth2*/
Change indent types
The default is to use 2 spaces.
If you want to the tab, Do the following.
;
In the case of the 4 spaces.
;
Settings
obj2indentdefaultIndent = " "; obj2indentkeys = name: "name" children: "children";
Browser Support
- IE6 +
- Chrome
- Firefox
- Safari
- iOS
- Android
License
Released under the MIT Licence