https://github.com/artdecocode/paddys
Pad strings to equalise the length of each line.
https://github.com/artdecocode/paddys
Last synced: 10 months ago
JSON representation
Pad strings to equalise the length of each line.
- Host: GitHub
- URL: https://github.com/artdecocode/paddys
- Owner: artdecocode
- License: mit
- Created: 2018-10-15T21:02:00.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-25T07:49:44.000Z (about 7 years ago)
- Last Synced: 2025-02-09T01:35:07.995Z (over 1 year ago)
- Language: JavaScript
- Homepage: https://artdeco.bz
- Size: 40 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# paddys
[](https://npmjs.org/package/paddys)
`paddys` is a package that pads strings so that each line is of the width of the longest line. It can also pad to a specific length.
```sh
yarn add -E paddys
```
## Table Of Contents
- [Table Of Contents](#table-of-contents)
- [API](#api)
- [`paddys(string: string, options?: Config): string`](#paddysstring-stringoptions-config-string)
* [`_paddys.Config`](#type-_paddysconfig)
- [Copyright](#copyright)
## API
The package is available by importing its default function:
```js
import paddys from 'paddys'
```
## `paddys(`
`string: string,`
`options?: Config,`
`): string`
Pads the string to the right to equalise the length of each line.
__`_paddys.Config`__: Options for the program.
| Name | Type | Description |
| ----- | --------------- | -------------------------------- |
| width | number | The width to which to pad lines. |
```js
/* yarn example/ */
import paddys from 'paddys'
const res = paddys(
`Just stop your wandering,
Look penetratingly into your inherent nature,
And, concentrating your spiritual energy,
Sit in zazen
And break through.`
)
```
```
Just stop your wandering,____________________
Look penetratingly into your inherent nature,
And, concentrating your spiritual energy,____
Sit in zazen_________________________________
And break through.___________________________
```
## Copyright
© Art Deco 2019
Tech Nation Visa Sucks