solid-square

Render a solid square of varying sizes and colors

Usage no npm install needed!

<script type="module">
  import solidSquare from 'https://cdn.skypack.dev/solid-square';
</script>

README

solid-square Build Status codecov

Render solid squares of varying sizes and colors

Install

$ npm install solid-square

Usage

const solidSquare = require('solid-square');

console.log(solidSquare(10));
// ████████████████████
// ████████████████████
// ████████████████████
// ████████████████████
// ████████████████████
// ████████████████████
// ████████████████████
// ████████████████████
// ████████████████████
// ████████████████████
const solidSquare = require('solid-square');

console.log(
  solidSquare(10, {
    character: '☺',
    color: 'yellow',
    scale: .5
  });
);
// ☺☺☺☺☺☺☺☺☺☺
// ☺☺☺☺☺☺☺☺☺☺
// ☺☺☺☺☺☺☺☺☺☺
// ☺☺☺☺☺☺☺☺☺☺
// ☺☺☺☺☺☺☺☺☺☺

API

solidSquare(size, [options])

size

Type: number

The size of your square.

options

Type: Object

character

Type: string
Default: ██

The character to use for each cell.

color

Type: string
Default: undefined

The character to use for each cell.

scale

Type: string
Default: undefined

Y-axis size multiplier.

License

MIT © Chris Vogt