Socket
Socket
Sign inDemoInstall

as-data-uri-cli

Package Overview
Dependencies
2
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    as-data-uri-cli

Command line tool to encode data into a data URI.


Version published
Weekly downloads
1
Maintainers
1
Install size
52.1 kB
Created
Weekly downloads
 

Readme

Source

as-data-uri-cli

Command line tool to encode data into a data URI.

Similar to data-uri-to-file-cli, but

  • only uses stdio instead of read and writing files
  • supports url-encoded data URIs (e.g. data:text/plain,hello%20world)
  • supports an optional charset

npm version build status ISC-licensed chat on gitter

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:

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.

Keywords

FAQs

Last updated on 12 Feb 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc