Skip to content

Gustavoohrq/skincare-json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Skincare JSON ✨🧽

AGPL

Installation 📜

npm install skincare-json

or

yarn add skincare-json

It does the cleaning treatment and the conversion of a JSON.

Turn this:

{ 
  "whatever": ",
  "whatever2": "easy "peasy" ""lemon squeezy"",
  "whatever3": "\rwhata"",
}

Into this:

{ 
  "whatever": "",
  "whatever2": "easy peasy lemon squeezy,
  "whatever3": "whata",
}

Examples

const skinJSON = require('skincare-json');
const jsonDirty = '{
      "whatever": ",
      "whatever2": "easy "peasy" ""lemon squeezy"",
      "whatever3": "\rwhata"",
    }'
    try {
      const jsonClean = JSON.parse(jsonDirty);
    } catch (error) {
      const jsonClean = skinJSON.parse(jsonDirty);
    }
console.log(jsonClean);

🙋‍♂️ Author

License

This project is licensed under the GNU GPL V3 - see the LICENSE.md file for details

Releases

No releases published

Packages

No packages published