escape-json-node

Escape nested double quotes and unescape apostrophes within JSON string.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
escape-json-node
2.0.1a year ago8 years agoMinified + gzip package size for escape-json-node in KB

Readme

⚠️ This package is deprecated.
!escape-json-node Logologo
Escape nested double quotes and unescape apostrophes within JSON string.
!NPM Package Versionnpm-package-version-badgenpm-package-url !NPM Package Downloadsnpm-package-downloads-badgenpm-package-url !NPM Package Licensenpm-package-license-badgenpm-package-license-url

Installation

npm install escape-json-node

Usage Example

var escapeJSON = require('escape-json-node');

var JSONString = '{"quoteText": "\'Acceptance says, "True, this is ' +
'my situation at the moment. I\'ll look unblinkingly at the reality of it. ' +
'But I will also open my hands to accept willingly whatever a loving ' +
'Father sends me.""}';

JSONString = escapeJSON(JSONString);

console.log(JSONString);


{"quoteText": "'Acceptance says, \"True, this is my situation at the moment.
I'll look unblinkingly at the reality of it. But I will also open my
hands to accept willingly whatever a loving Father sends me.\""}

Tests

To run the test suite, first install the dependencies, then run npm test:
$ npm install
$ npm test

License

Distributed under the MIT License
.