dataurl

command module
v0.0.0-...-3b00c42 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 4 Imported by: 0

README

dataurl

convert given file to data URL

Installation

$ go install github.com/abiriadev/dataurl@latest

Usage

Encode

$ dataurl ./image.png
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5C

Specify MIME types

$ 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

$ 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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL