Parse and encode (plain or Base64) data URIs with JSON content and correct MIME type.
This module exports an object that holds these functions:
Try to parse JSON data from a data URI given as string uri
.
Returns decoded data, or undefined
if there was an error.
Convert JSON-able data
to a plain text data: URI.
Returns a URI as a string.
With bad input, the content part of the URI will be broken.
Convert JSON-able data
to a base64-encoded data: URI.
Returns a URI as a string.
With bad input, the content part of the URI will be broken.
see test/usage.mjs.
- Needs more/better tests and docs.
ISC