JSPM

solid-square

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q18089F
  • License MIT

Render a solid square of varying sizes and colors

Package Exports

  • solid-square

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (solid-square) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

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