Compress JSON with JSONCRUSH

78 views
Skip to first unread message

Jan

unread,
Dec 14, 2020, 10:49:47 AM12/14/20
to TiddlyWiki
Hi Tiddlywikians.
I just encountered the a library which can verry efficiently reduce the
size of JSON files.

https://github.com/KilledByAPixel/JSONCrush

So far I do not have a TW-usecase for this. But I want to share it with
you because maybe someone else can build something with that.

Best wishes Jan

TW Tones

unread,
Dec 14, 2020, 4:52:48 PM12/14/20
to TiddlyWiki
Jan,

I have recently being importing CSV files containing data, and generating large plugins/JSON files with JSON Mangler. In this case a product inventory from an online store.

Whilst I can see value for compression/expansion of a JSON file on import and export, when it is in the Wiki the main value is in being able to access the (shadow) tiddlers within. Although if a wiki was to be a repository of json data it would benefit from compression. 

There is now the zip plugin in the pre-release of course.

Interesting.
Tones

Jeremy Ruston

unread,
Dec 15, 2020, 6:07:36 AM12/15/20
to TiddlyWiki Group
Just to add that the library is designed to encode/compress JSON so that it can be more efficiently stored in URLs. It avoids characters that have to be escaped when URI encoded. So it is not exactly a general purpose JSON compression library; for that straightforward ZIP compression would seem to make more sense.

Best wishes

Jeremy

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/9a4508cd-f22c-4b08-8971-4f7dcc81454cn%40googlegroups.com.

Ste

unread,
Dec 15, 2020, 12:39:45 PM12/15/20
to TiddlyWiki

So could it be employed to get those tiddly sites in a link working consistently that we were playing with? If memory serves it stalled because of special chars in the url. Or did it get finesses and done and I just missed it! :)

Jeremy Ruston

unread,
Dec 15, 2020, 12:46:05 PM12/15/20
to TiddlyWiki Group
So could it be employed to get those tiddly sites in a link working consistently that we were playing with? If memory serves it stalled because of special chars in the url. Or did it get finesses and done and I just missed it! :)

The “share” plugin does indeed embed JSON into an URL, and so could indeed benefit. The challenge we found was that many platforms wouldn’t correctly recognise the entire link, which could possibly be something that a better encoding might fix.

Best iwshes

Jeremy

TW Tones

unread,
Dec 15, 2020, 6:43:53 PM12/15/20
to TiddlyWiki
Jeremy,

On the zip plugin I see value in proving preconfigured template to zip and export;
  • Larger JSON/plugin files as in this thread
  • static sites
  • library files with nominated plugins (I am really keen on this)
    • The first thing I will do is use it to generate a library of plugin libraries and my own plugins and macros.
  • Full backup zip
  • Save Changes only zip
  • Save Local Storage  only zip
The question that arises is decompression/ restoration from Zip.

Tones

Reply all
Reply to author
Forward
0 new messages