json-prototypes
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

json-prototypes

import 'json-prototypes'

const data = { info: true, result: '0x123d' }

const jsonString = JSON.stringify(data)

if (jsonString.isValidJSON()) {
  const parsed = jsonString.parseJSON<typeof data>(console.error)

  console.log(parsed)
}

const beauty = jsonString.formatJSON()

console.log(beauty)
console.log(beauty.toSha256Hex())

Readme

Keywords

none

Package Sidebar

Install

npm i json-prototypes

Weekly Downloads

2

Version

0.0.1

License

ISC

Unpacked Size

68.2 kB

Total Files

7

Last publish

Collaborators

  • wizardsorb