node-bencode
node-bencode copied to clipboard
use '-' instead of ':' so it can be used in query parameters wihtout …
… '%3A' at every string delimitator
What is the purpose of this pull request? (put an "X" next to item)
[ ] Documentation update [ ] Bug fix [x] New feature [ ] Other, please explain:
What changes did you make? (Give an overview)
It allows to encode/decode using '-' as string delimitator, so it plays nicer with urls
encodeURIComponent replaces ':' with '%3Awhich makes the url longer and ugglier but it allows'-'`
Which issue (if any) does this pull request address?
I just wanted to serialize some data I want to send as a query parameter in the shortest and nicest way possible. I though of bencode but I realized it could be better for urls if we use - instead of :
So it only requires you to run
Is there anything you'd like reviewers to focus on?
🙌 Thanks for opening this pull request! You're awesome.

can you remove the package-lock.json file and the package.json changes?
I don't need this anymore. I close it to clean my open PRs list.