New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@httpie/json

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@httpie/json

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

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source


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 😊

  • Create a fork
  • Create your feature branch: git checkout -b my-feature
  • Commit your changes: git commit -am 'Add some feature'
  • Push to the branch: git push origin my-new-feature
  • Submit a pull request 🚀

License

MIT © Supercharge

httpiejs.com  ·  GitHub @httpie  ·  Twitter @httpiejs

Keywords

nodejs

FAQs

Package last updated on 24 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts