Skip to content

Instantly share code, notes, and snippets.

View Mansh05's full-sized avatar

Manish Sharma Mansh05

  • Secure Link Services
  • Thimphu, Bhutan
View GitHub Profile
@Mansh05
Mansh05 / test.js
Created June 9, 2018 10:24
JSON parser which helps us check whether it has been formatted correctly
let fs = require('fs');
let checkJson = (path) => {
fs.readdir(path, (err, files) => {
files.forEach(file => {
if (fs.lstatSync(`${path}/${file}`).isDirectory()) {
checkJson(`${path}/${file}`)
} else {
readFile(`${path}/${file}`);
}