Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@everymundo/json-utils

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@everymundo/json-utils

JSON Utilities such as safe JSON parser and pretty JSON stringifier.

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
44
increased by214.29%
Maintainers
1
Weekly downloads
 
Created
Source

@everymundo/json-utils

JSON Utilities such as safe JSON parser and pretty JSON stringifier.

parseJson

Whenever we use JSON.parse we have to use it inside a try-catch block because a malformed json will raise an Error.

parseJson will do that for you and will return the Error object in case of an Error or your parsed object in case of success.

It's also known that a function with a try-catch block in it is almost always slower than its version without a try-catch block, thus using parseJson and checking whether or not the result is an instance of Error is usually faster than using a try catch block inside your function.

prettyJson

This is a very simple shortcut way to use JSON.stringify(variable, undefined, ' ');, calling prettyJson(variable) looks nicer;

Keywords

FAQs

Package last updated on 28 Jan 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc