Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

domscii

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

domscii

DOM to ASCII

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

domscii • demo

Convert arbitrary DOM elements to ASCII

Installation

<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.5.0-beta1/html2canvas.min.js"></script>
<script src="https://rawgit.com/dbkaplun/domscii/v1.0.4/domscii.js"></script>

Usage

function handleASCII (ascii) { console.log(ascii); }
domscii(opts).then(handleASCII);
// or
domscii(el).then(handleASCII);

Options

domscii({
    // REQUIRED
    el: undefined, // The element to render to ASCII.

    // DEFAULTS
    template: '<span style="color:${color}">${char}</span>', // How each character is formatted. Replaces '${color}' with an RGB value, and '${char}' with a representative ASCII character. For plaintext rendering, use '${char}'.
    chars: '@#$=*!;:~-,.', // The ASCII characters to use for rendering, darkest to lightest. This can also be an array of strings.
    newline: '\n', // The string to use for starting a new line of ASCII.
    scaleX: 7.875, // Determines how many pixels are used for one ASCII character, horizontally.
    scaleY: 15, // Determines how many pixels are used for one ASCII character, vertically.
    html2canvas: {} // Specify html2canvas options. http://html2canvas.hertzen.com/documentation.html#available-options
});

FAQs

Package last updated on 05 Nov 2015

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc