https://github.com/artdecocode/frame-of-mind
Add a frame around strings.
https://github.com/artdecocode/frame-of-mind
Last synced: about 1 month ago
JSON representation
Add a frame around strings.
- Host: GitHub
- URL: https://github.com/artdecocode/frame-of-mind
- Owner: artdecocode
- License: mit
- Created: 2018-10-15T21:02:45.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-25T09:07:58.000Z (about 7 years ago)
- Last Synced: 2025-02-08T13:23:58.852Z (over 1 year ago)
- Language: JavaScript
- Homepage: https://artdeco.bz
- Size: 48.8 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
# frame-of-mind
[](https://npmjs.org/package/frame-of-mind)
`frame-of-mind` adds a frame around strings.
```sh
yarn add -E frame-of-mind
```
## Table Of Contents
- [Table Of Contents](#table-of-contents)
- [API](#api)
- [`frameOfMind(string: string, options?: Config): string`](#frameofmindstring-stringoptions-config-string)
* [`_frameOfMind.Config`](#type-_frameofmindconfig)
- [Copyright](#copyright)
## API
The package is available by importing its default function:
```js
import frameOfMind from 'frame-of-mind'
```
## `frameOfMind(`
`string: string,`
`options?: Config,`
`): string`
This function will add a frame around strings with single or multiple lines.
__`_frameOfMind.Config`__: Options for the program.
| Name | Type | Description | Default |
| ------- | --------------- | --------------------------- | ------- |
| padding | number | The left and right padding. | `1` |
```js
import frameOfMind from 'frame-of-mind'
const res = frameOfMind(
`There are thousands upon thousands of students
who have practised meditation and obtained its fruits.
Do not doubt its possibilities because of the simplicity of the method.
If you can not find the truth right where you are,
where else do you expect to find it?`
)
```
```
┌─────────────────────────────────────────────────────────────────────────┐
│ There are thousands upon thousands of students │
│ who have practised meditation and obtained its fruits. │
│ Do not doubt its possibilities because of the simplicity of the method. │
│ If you can not find the truth right where you are, │
│ where else do you expect to find it? │
└─────────────────────────────────────────────────────────────────────────┘
```
## Copyright
© Art Deco 2019
Tech Nation Visa Sucks