1.1.1 • Published 1 year ago

ascii-art-maker v1.1.1

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

ascii-art-maker:An ASCII art generator in node.js

Installationgeneratefiglet
-UsageUsage
-ExamplesExamples

Installation

In the shell:$ npm install ascii-art-maker

In your JavaScript:const ASCII = require('ascii-art-maker')

generate

Usage

ASCII.generate(image, opts) Returns a Promise that resolves with the ASCII art.

image is either a Jimp object or a path to the image opts is an object with the following properties: | Property | Value | Description | Default | | - | - | - | - | | width | number | The width, in output pixels, of the output. Note that each output pixel is two characters wide, so the width in characters will be twice this value. | 64 | | height | number | The height, in characters, of the output. | 64 | | grad | "lbg" \| "dbg" \| string[] | The gradient used in the output. Use 'lbg' for the default light background gradient and 'dbg' for the default dark background. If using an array, note that it goes from darkest to lightest. | "lbg" | | color | boolean | Whether or not to color the output. This uses ANSI escape codes. | false |

Examples

const ASCII = require('ascii-art-maker')
const log = async () => {console.log(
  ASCII.generate('./content/images/peppers.jpg', {
    width: 64, height: 64,
    grad: 'lbg',
    color: true,
  })
)}
log()

const ASCII = require('ascii-art-maker')
ASCII.generate('./content/images/lenna.jpg', {
  width: 128, height: 128,
  grad: 'dbg',
  color: false,
}).then(art => {console.log(art)})

figlet

Usage

ASCII.figlet(str, font) Returns a Promise that resolves with the banner text.

str is a string font is the path to a FIGlet font file (standard.flf is included with the package and is the default value)

Examples

const ASCII = require('ascii-art-maker')
const log = async () => {console.log(
  ASCII.figlet('hi there')
)}
log()

const ASCII = require('ascii-art-maker')
ASCII('figlet text', './small.flf')
  .then(art => {console.log(art)})
1.1.1

1 year ago

1.1.0

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago