Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/derhuerst/as-data-uri-cli
Command line tool to encode data into a data URI.
https://github.com/derhuerst/as-data-uri-cli
base64 cli convert data-uri encode
Last synced: 6 days ago
JSON representation
Command line tool to encode data into a data URI.
- Host: GitHub
- URL: https://github.com/derhuerst/as-data-uri-cli
- Owner: derhuerst
- License: isc
- Created: 2018-02-12T12:12:38.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-12T12:12:50.000Z (almost 7 years ago)
- Last Synced: 2024-10-03T23:53:55.113Z (about 1 month ago)
- Topics: base64, cli, convert, data-uri, encode
- Language: JavaScript
- Homepage: https://github.com/derhuerst/as-data-uri-cli#as-data-uri-cli
- Size: 4.88 KB
- Stars: 3
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
# as-data-uri-cli
**Command line tool to encode data into a [data URI](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs).**
Similar to [`data-uri-to-file-cli`](https://github.com/ragingwind/data-uri-to-file-cli), but
- only uses [stdio](https://en.wikipedia.org/wiki/Standard_streams#Standard_input_(stdin)) instead of read and writing files
- supports url-encoded data URIs (e.g. `data:text/plain,hello%20world`)
- supports an optional charset[![npm version](https://img.shields.io/npm/v/as-data-uri-cli.svg)](https://www.npmjs.com/package/as-data-uri-cli)
[![build status](https://api.travis-ci.org/derhuerst/as-data-uri-cli.svg?branch=master)](https://travis-ci.org/derhuerst/as-data-uri-cli)
![ISC-licensed](https://img.shields.io/github/license/derhuerst/as-data-uri-cli.svg)
[![chat on gitter](https://badges.gitter.im/derhuerst.svg)](https://gitter.im/derhuerst)## Usage
```
Usage:
as-data-uri [--url-encoded] [--mime mime-type] [--charset utf8]Options:
--url-encoded -u Url-encode instead of base64.
--mime -m Specify a mime type. Default: text/plain.
--charset -c Specify an optional charset (for text only).Examples:
echo -n 'hello world' | as-data-uri --mime text/plain --url-encoded
cat picture.png | as-data-uri --mime image/png | pbcopy
```If you have installed it:
```shell
echo -n 'Hello World!' | as-data-uri -m text/plain -u
# data:text/plain,hello%20world
cat foo.png | as-data-uri -m image/png
# data:image/png;base64,iVBORw0K…CYII=
```## Contributing
If you have a question or have difficulties using `as-data-uri-cli`, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, refer to [the issues page](https://github.com/derhuerst/as-data-uri-cli/issues).