JSPM

@httpie/json

1.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q27108F
  • License MIT

Secure drop-in replacement for the global `JSON` object

Package Exports

  • @httpie/json

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@httpie/json) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme



JSON

Secure drop-in replacement for the global `JSON` object with prototype pollution protection


Installation ยท Usage



Latest Version Monthly downloads

Follow @eldorplus and @httpiejs for updates!


Introduction

The @httpie/json package is a drop-in replacement for the global JSON object. It protects JSON parsing against protoype pollution attacks.

Installation

npm i @httpie/json

Usage

Using @httpie/json is pretty straightforward. Use it the same way as you would use the JSON object:

const JSON = require('@httpie/json')

const user = JSON.parse('{"name":"Supercharge"}')
// { name: 'Supercharge' }

const user = JSON.parse('{"name":"Supercharge", "__proto__": { "x": 1 }, "constructor": {"prototype": {"bar": "baz"} } }')
// { name: 'Supercharge' }


const json = JSON.stringify({ name: 'Supercharge' })
// '{"name":"Supercharge"}'

Contributing

Do you miss a function? We very much appreciate your contribution! Please send in a pull request ๐Ÿ˜Š

  1. Create a fork
  2. Create your feature branch: git checkout -b my-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request ๐Ÿš€

License

MIT ยฉ Supercharge


httpiejs.com  ·  GitHub @httpie  ·  Twitter @httpiejs