https://github.com/chrisvogt/solid-square
Render solid squares of varying sizes and colors
https://github.com/chrisvogt/solid-square
node-module nodejs path rectangle shape square
Last synced: 11 days ago
JSON representation
Render solid squares of varying sizes and colors
- Host: GitHub
- URL: https://github.com/chrisvogt/solid-square
- Owner: chrisvogt
- License: mit
- Created: 2018-10-21T18:16:54.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T00:57:40.000Z (about 3 years ago)
- Last Synced: 2025-09-30T22:49:25.052Z (4 months ago)
- Topics: node-module, nodejs, path, rectangle, shape, square
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/solid-square
- Size: 465 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# solid-square [](https://travis-ci.org/chrisvogt/solid-square) [](https://codecov.io/gh/chrisvogt/solid-square?branch=master)
> Render solid squares of varying sizes and colors
## Install
```
$ npm install solid-square
```
## Usage
```js
const solidSquare = require('solid-square');
console.log(solidSquare(10));
// ████████████████████
// ████████████████████
// ████████████████████
// ████████████████████
// ████████████████████
// ████████████████████
// ████████████████████
// ████████████████████
// ████████████████████
// ████████████████████
```
```js
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](https://chrisvogt.me)