itty-bitty icon indicating copy to clipboard operation
itty-bitty copied to clipboard

ES modules or a CommonJS

Open pokatomnik opened this issue 6 years ago • 4 comments

Do you have any plans to implement any of them? I'd like to make a PR with It, if it's okay for you.

pokatomnik avatar Jul 07 '18 13:07 pokatomnik

How would you like to see them done? (Show an example?)

alcor avatar Jul 08 '18 15:07 alcor

Smth like

import { decompress } from 'itty-bitty'
const decompressedData = decompress(window.location.hash);
doSomethingWithDecompressedData(decompressedData);

and

import { compress } from 'itty-bitty'

const compressed = compress(someData);
window.location.hash = compressed;

And of course, publishing your library as npm package is required. The idea is really useful, but how could any developer use It?

pokatomnik avatar Jul 16 '18 14:07 pokatomnik

OK, I understand that you don't have a time to resolve my issue. I just need to ask your permission to publicate compression-related code as the npm package. I mean your data.js. As I see this repo is a completed web application, so I'd like to isolate URL compression code. I need It to use in my own project, @alcor.

pokatomnik avatar Jul 25 '18 20:07 pokatomnik

I added a node entry to the ReadMe... There is a refactoring underway, that might be helpful, as even today, there is support for plain base64 and lzma, with planned support language dictionary compression. It may be nice to have a library that is always up to date with the latest itty-bitty API

https://github.com/alcor/itty-bitty/pull/40/files

FossPrime avatar Jul 26 '18 21:07 FossPrime