___ _ _ ___ ____ _ __ _ ____ ____ ___ ___
/ _ \| | | |_ _/ ___| |/ / / \ / ___| / ___|_ _|_ _|
| | | | | | || | | | ' /_____ / _ \ \___ \| | | | | |
| |_| | |_| || | |___| . \_____/ ___ \ ___) | |___ | | | |
\__\_\\___/|___\____|_|\_\ /_/ \_\____/ \____|___|___|
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:
_ _ _ _ _
| | | | ___| | | ___ | |
| |_| |/ _ \ | |/ _ \| |
| _ | __/ | | (_) |_|
|_| |_|\___|_|_|\___/(_)
Functions:
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- )| .| |/ | | | |\ :` `. '--. .--'| |
| | .--, \| |\_) | |\| | '..`''.) | | | .'
(| | '. (_/| .-. | \ | | | |.-._) \ | | `--'
| '--' | | | | | `' '-' '\ / | | .--.
`------' `--' `--' `-----' `-----' `--' '--'
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 object has 3 parameters which you can use/set:
Type: String
Default value: 'Standard'
A string value that indicates the quick-ascii which font to use.
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.
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