@urlpack/json
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

@urlpack/json

Package Version License Bundle Size

Compress JSON data into compact & URL-safe formats

  • ES Modules & Browser compatible
  • Compact output using MessagePack
  • URL safe formats (Base62, Base58)
  • Composable & Tree-shakable

Usage

import { makeJsonEncoder } from '@urlpack/json';

const encoder = makeJsonEncoder();

encoder.encode({
  href: 'http://daangn.com',
  uid: 1234567,
  context: {
    foo: 'bar',
    baz: [1,2,3,4,5],
  },
})
// => 'QL3sGqgSwhebCV6jsPsxSCG6DPGZUAo7qtLbEFxFN3bequ3qABcg6pxvpvr36FveMxCtD4zNSWSpHmxgz8'
//
// Only 82 characters, 35% smaller output than JSON.stringify + lz-string

LICENSE

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @urlpack/json

Weekly Downloads

58

Version

2.0.0

License

MIT

Unpacked Size

10.7 kB

Total Files

14

Last publish

Collaborators

  • cometkim
  • kyoungduck