# as-data-uri-cli

> Command line tool to encode data into a data URI.

Latest version **0.1.0** (published 2018-02-12) · ISC license · 0 weekly downloads

## Install

```sh
npm install as-data-uri-cli
pnpm add as-data-uri-cli
yarn add as-data-uri-cli
bun add as-data-uri-cli
```

Provides the command `as-data-uri`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2018-02-12 |
| First published | 2018-02-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 2 |
| Unpacked size | 5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Jannis R |
| Maintainers | derhuerst |
| Keywords | data uri, cli, encode, convert, inline, base64 |

## Links

- npm: https://www.npmjs.com/package/as-data-uri-cli
- Repository: https://github.com/derhuerst/as-data-uri-cli
- Issues: https://github.com/derhuerst/as-data-uri-cli/issues
- npm.io page: https://npm.io/package/as-data-uri-cli

## Dependencies (2)

- [mri](https://npm.io/package/mri.md) ^1.1.0
- [node-rfc2397](https://npm.io/package/node-rfc2397.md) ^3.0.1

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads
- [datasets-fi-postalcodes](https://npm.io/package/datasets-fi-postalcodes.md) — 1.1K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2018-02-12

## 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).

---
_Source: https://npm.io/package/as-data-uri-cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
