Are there any libraries/etc. that implement lightweight text compression in JavaScript?
My real goal is to slightly shorten some text and make it inconspicuous at a glance. (It needn't provide security -- the text will be displayed for the user.) Ideally the compression could be tweaked to output only the query characters
[-._~!$&'()*+,;=:@/?a-zA-Z0-9]
so it can be passed in a URL. (Actually, this is kind of important -- if other characters are used they'd have to be percent-encoded, which will probably make the text larger than the original.) Of course rare characters could be percent-encoded if needed.
Any ideas? Failing that, suggestions for making a simple one? The compression doesn't have to be great but shorter URLs would be nicer. The text to be compressed should be English sentences: mostly lower-case letters, spaces, and punctuation with the occasional upper-case letters, digits, and newlines.