Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abiriadev/dataurl
convert given file to data URL
https://github.com/abiriadev/dataurl
data-url dataurl
Last synced: 25 days ago
JSON representation
convert given file to data URL
- Host: GitHub
- URL: https://github.com/abiriadev/dataurl
- Owner: abiriadev
- License: mit
- Created: 2023-12-14T05:00:46.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-04-20T14:58:36.000Z (7 months ago)
- Last Synced: 2024-06-21T17:05:38.042Z (5 months ago)
- Topics: data-url, dataurl
- Language: Go
- Homepage:
- Size: 17.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
dataurl
convert given file to data URL
# Installation
```sh
$ go install github.com/abiriadev/dataurl@latest
```# Usage
## Encode
```sh
$ dataurl ./image.png
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5C
```## Specify MIME types
```sh
$ dataurl ./post.md
data:text/markdown; charset=utf-8;base64,IyBIZWxsbywgd29ybGQh$ dataurl --mime 'text/plain; charset=UTF-8' ./post.md
data:text/plain; charset=UTF-8;base64,IyBIZWxsbywgd29ybGQh
```## Read from standard input
```sh
$ dataurl < ./post.md
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5C$ dataurl --mime 'text/plain; charset=UTF-8' ./post.md
data:text/plain; charset=UTF-8;base64,IyBIZWxsbywgd29ybGQh
```# License
[![Licence](https://img.shields.io/github/license/abiriadev/dataurl?style=for-the-badge)](./LICENSE)