An open API service indexing awesome lists of open source software.

https://github.com/noah227/justify


https://github.com/noah227/justify

Last synced: 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# justify

> Python style string justify.

## install

```shell
npm i @cynario/justify
```

## usage

```js
import {center, ljust, rjust} from "./index"
// import {justify} from "./index"
// justify.ljust
// ...

const s = "hello"

console.log(ljust(s, 8, "*"))
console.log(rjust(s, 8, "*"))
console.log(center(s, 8, "*"))
console.log(center(s, 9, "*"))

// hello***
// ***hello
// *hello**
// **hello**
```