ladder

ladder =====

ladder

A library to detect JSON indentation

$ npm install ladder
$ npm test

####ladder(jsonString)

jsonString is a valid json string. It returns either the number of spaces or '\t' if tabs are used

test.json

{
  "test": "hellow"
}

example.js

var ladder = require('ladder'),
    fs     = require('fs'),
    path   = require('path');
 
fs.readFile(path.resolve('./test.json'), function(edata) {
  console.log(ladder(data.toString())); // => 2 
});

MIT