nvp-json
v1.1.2
Published
A bidirectional NVP/JSON parser for use with PayPal NVP APIs.
Downloads
61
Maintainers
Readme
nvp-json
A bi-directional NVP-JSON parser, for use with PayPal's NVP APIs.
Tested with Node >= 6 LTS.
Installation
npm install nvp-json
or
yarn add nvp-json
Usage
const nvpjson = require('nvp-json');
let nvpString = 'KEY=VALUE&ESCAPED[5]=& [1]=';
let json = nvpjson.toJSON(nvpString);
/*
* {KEY: 'VALUE', ESCAPED: '& [1]='}
*/
let nvp = nvpjson.toNVP({
KEY: 'VALUE',
ESCAPED: '& [1]='
});
/*
* KEY=VALUE&ESCAPED[5]=& [1]=
*/