Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kamataryo/outdent
https://github.com/kamataryo/outdent
Last synced: 4 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/kamataryo/outdent
- Owner: kamataryo
- Created: 2018-06-07T04:43:49.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2024-03-07T23:32:45.000Z (11 months ago)
- Last Synced: 2024-12-18T20:41:59.908Z (about 1 month ago)
- Language: TypeScript
- Homepage:
- Size: 75.2 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# outdent
Outdent is a simple here document generator with pretty indents.
## install
```shell
$ npm install @kamataryo/outdent
# or
$ yarn add @kamataryo/outdent
# or
$ bun install @kamataryo/outdent
```## usage
```typescript
import { test, expected } from 'bun:test'test('the example in README', () => {
let expected, actual
{
{
{
// not pretty 🤔
expected = `Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.`
}
}
}{
{
{
// pretty 🥺
actual = outdent`
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
`
}
}
}expect(actual).toBe(expected)
})
```