tus-metadata
Encode and decode Tus Upload-Metatada.
Install
npm install --save tus-metadata
Requires Node v6+
Usage
See ./test directory for usage examples.
decode(str)
Accepts an Upload-Metadata
encoded string and returns a key/value object.
encode(obj)
Accepts an object and returns an Upload-Metadata
encoded string.
const str = 'filename d29ybGRfZG9taW5hdGlvbl9wbGFuLnBkZg==, mimetype dGV4dC9wbGFpbgo=' // => {filename: 'world_domination_plan.pdf', mimetype: 'text/plain'} // => filename d29ybGRfZG9taW5hdGlvbl9wbGFuLnBkZg==,mimetype dGV4dC9wbGFpbgo=