🔑 Sort-Key
Tiny library for generating and parsing DynamoDB sort keys.
Generating DynamoDB sort keys from multiple string parts as recommended by
AWS. It uses
#
as separator and knows how to escape it when given on one of the key parts.
[country]#[region]#[state]#[county]#[city]#[neighborhood]
Install
npm i sort-key
Usage
; ;// 1532208#2020-09-11T15:30:06.822Z ;// "1532208" "2020-09-11T15:30:06.822Z"
It supports escaping as well:
;// example.com#foo#https://example.com/foo/bar\#top ;// "example.com" "foo" "https://example.com/foo/bar#top"