https://github.com/techplexengineer/json_sanitizer
Parse any JSON that would be valid in javascript
https://github.com/techplexengineer/json_sanitizer
Last synced: 6 months ago
JSON representation
Parse any JSON that would be valid in javascript
- Host: GitHub
- URL: https://github.com/techplexengineer/json_sanitizer
- Owner: TechplexEngineer
- License: mit
- Created: 2014-10-30T19:14:00.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2016-05-31T13:26:37.000Z (almost 10 years ago)
- Last Synced: 2025-01-07T23:36:21.361Z (about 1 year ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/json_sanitizer
- Size: 3.91 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: LICENSE.txt
Awesome Lists containing this project
README
json_sanitizer
==============
Parse any JSON that would be valid in javascript
## Example
```javascript
var json_sanitizer = require('json_sanitizer');
//Fill the json variable with javascript valid JSON
var json = "{ s_id:\"0\",\"t\":[1414696794,1414696788,1414696776,1414696764,1414696752,1414696740,], \"vrms\":[119.589,119.514,119.607,119.641,119.361,119.486],\"irms\":[ 0.366, 0.366, 0.362, 0.364, 0.366, 0.362, ], \"app\": [ 43.813, 43.785, 43.327, 43.576, 43.729, 43.283, ], \"core_id\": \"53ff6d065067544847310187\", }";
json_sanitizer(json, function(err, result){
if (!err) {
console.log(JSON.parse(result)); //should never throw an error
} else {
console.log("ERROR", err);
}
});
```