i have a `json` within a folder that comes from **third party** i don't have control on `json` data just i need to `parse` it and manipulate.

**some time i will get this error:**

> 
> Uncaught SyntaxError: Unexpected end of JSON input
>  at JSON.parse
> 
> 
> 

json is valid json but due to some special character i get above error:

> 
> R:\30-09-18\LTP\p
> 
> 
> 

**some time i will get parse error:**

> 
> unable to parse .........
> 
> 
> 

**Question:** how can i remove all special characters so that `JSON.parse(data);` will not throw any `error`

**here is what i'm trying:**

```
var fs = require('fs');
var path = require('path');
var fileLoc = path.join(__dirname,'file.json');
var content = fs.readFileSync(fileLoc,'utf8');
content = JSON.parse(filecontent);  // error occurs here

```

please help me thanks in advance!!!