1.0.4 • Published 6 years ago

quick-ascii v1.0.4

Weekly downloads
6
License
MIT
Repository
github
Last release
6 years ago
   ___  _   _ ___ ____ _  __       _    ____   ____ ___ ___ 
  / _ \| | | |_ _/ ___| |/ /      / \  / ___| / ___|_ _|_ _|
 | | | | | | || | |   | ' /_____ / _ \ \___ \| |    | | | | 
 | |_| | |_| || | |___| . \_____/ ___ \ ___) | |___ | | | | 
  \__\_\\___/|___\____|_|\_\   /_/   \_\____/ \____|___|___|

Build Status

Quick Start - Node.js

npm install quick-ascii

Simple Usage:

var qa = require('quick-ascii');

qa('Hello!', function(err, data) {
    if (err) {
        console.log('Error!');
        console.dir(err);
        return;
    }
    console.log(data)
});

Prints following:

  _   _      _ _       _ 
 | | | | ___| | | ___ | |
 | |_| |/ _ \ | |/ _ \| |
 |  _  |  __/ | | (_) |_|
 |_| |_|\___|_|_|\___/(_)

Basic Usage - Node.js

Functions:

text

Calling the quick-ascii object as a function is shorthand for calling the text function. This method allows you to create ASCII Art from text. It takes in 3 parameters:

  • Input Text - A string of text to turn into ASCII Art.
  • Font Options - Either a string indicating the font name or an options object (description below).
  • Callback - A function to execute with the generated ASCII Art.

Example:

var qa = require('quick-ascii');

qa.text('Ghost!', {
    font: 'Ghost',
    horizontalLayout: 'default',
    verticalLayout: 'default'
}, function(err, data) {
    if (err) {
        console.log('Error!');
        console.dir(err);
        return;
    }
    console.log(data);
});

Prints following:

             ('-. .-.               .-')    .-') _   ,---. 
            ( OO )  /              ( OO ). (  OO) )  |   | 
  ,----.    ,--. ,--. .-'),-----. (_)---\_)/     '._ |   | 
 '  .-./-') |  | |  |( OO'  .-.  '/    _ | |'--...__)|   | 
 |  |_( O- )|   .|  |/   |  | |  |\  :` `. '--.  .--'|   | 
 |  | .--, \|       |\_) |  |\|  | '..`''.)   |  |   |  .' 
(|  | '. (_/|  .-.  |  \ |  | |  |.-._)   \   |  |   `--'  
 |  '--'  | |  | |  |   `'  '-'  '\       /   |  |   .--.  
  `------'  `--' `--'     `-----'  `-----'    `--'   '--'  

textSync

This method is the synchronous version of the method above.

  • Input Text - A string of text to turn into ASCII Art.
  • Font Options - Either a string indicating the font name or an options object (description below).

Example:

var qa = require('quick-ascii');

console.log(qa.textSync('Boo!', {
    font: 'Ghost',
    horizontalLayout: 'default',
    verticalLayout: 'default'
}));

Prints following:

  .-')                     .-') _          ,---. 
 ( OO ).                  ( OO ) )         |   | 
(_)---\_)  ,--.   ,--.,--./ ,--,'  .-----. |   | 
/    _ |    \  `.'  / |   \ |  |\ '  .--./ |   | 
\  :` `.  .-')     /  |    \|  | )|  |('-. |   | 
 '..`''.)(OO  \   /   |  .     |//_) |OO  )|  .' 
.-._)   \ |   /  /\_  |  |\    | ||  |`-'| `--'  
\       / `-./  /.__) |  | \   |(_'  '--'\ .--.  
 `-----'    `--'      `--'  `--'   `-----' '--'  

Font Options

Font options object has 3 parameters which you can use/set:

font

Type: String Default value: 'Standard'

A string value that indicates the quick-ascii which font to use.

horizontalLayout

Type: String Default value: 'default'

A string value that indicates the horizontal layout to use/set. quick-ascii fonts have 5 values for this: "default", full", "fitted", "controlled smushing", and "universal smushing". "default" does the kerning the way the font designer intended, "full" uses full letter spacing, "fitted" moves the letters together until they almost touch, and "controlled smushing" and "universal smushing" are common quick-ascii kerning setups.

verticalLayout

Type: String Default value: 'default'

A string value that indicates the vertical layout to use. quick-ascii fonts have 5 values for vertical layout: "default", full", "fitted", "controlled smushing", and "universal smushing". "default" does the kerning the way the font designer intended, "full" uses full letter spacing, "fitted" moves the letters together until they almost touch, and "controlled smushing" and "universal smushing" are common quick-ascii kerning setups.

For more info: Join our official Discord server

Discord: Bolt#6938

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago