nvp-json

A bidirectional NVP/JSON parser for use with PayPal NVP APIs.

Usage no npm install needed!

<script type="module">
  import nvpJson from 'https://cdn.skypack.dev/nvp-json';
</script>

README

nvp-json

npm version Build Status npm downloads Codacy Coverage

dependencies Build Status GitKraken

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]=
 */

License

MIT