2.2.6 • Published 2 years ago

@clynn-fe/akfe-editor-jsonc v2.2.6

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

@clynn-fe/akfe-editor-jsonc

JSON 压缩包。使用 gzip 压缩字符串。可选使用 map 来减少 key 长度。

Usage

import JSONC from '@clynn-fe/akfe-editor-jsonc'

// 使用 map 缩短 key 长度并使用 gzip 压缩
const result = JSONC.pack(obj, true)

// 只用 gzip 压缩
const result = JSONC.pack(obj, false)

// 只用 map 缩短 key
const result = JSONC.compress(obj)

// 解压使用 gzip 压缩并使用 map 缩短 key 长度的数据
const obj = JSONC.unpack(str, true)

// 解压只使用 gzip 压缩的数据
const obj = JSONC.unpack(str, false)

// 解压只使用 map 缩短 key 的数据
const obj = JSONC.decompress(str)
2.2.6

2 years ago

2.2.5

2 years ago