Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/botdio/slack_builder
slack text builder
https://github.com/botdio/slack_builder
Last synced: 8 days ago
JSON representation
slack text builder
- Host: GitHub
- URL: https://github.com/botdio/slack_builder
- Owner: botdio
- License: apache-2.0
- Created: 2017-01-24T02:54:05.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-01-24T03:25:32.000Z (almost 8 years ago)
- Last Synced: 2024-04-25T03:20:54.532Z (7 months ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# slack_builder
[![Build Status](https://travis-ci.org/botdio/slack_builder.svg?branch=master)](https://travis-ci.org/botdio/slack_builder)
use builder design pattern to compose the slack simple Markdown text, in chain style## examples:
```
new SlackBuilder("abc") => abc
new SlackBuilder().text("abc") => abc
new SlackBuilder("abc").b() => *abc*
new SlackBuilder("abc").b("def") => abc *def*
new SlackBuilder("abc").i() => _abc_
new SlackBuilder("abc").br().text('def') => abc\ndef
new SlackBuilder("abc").del() => ~abc~
new SlackBuilder("abc").code("hello,world") => abc `hello,world`
new SlackBuilder("abc").pre("hello\nworld") => abc ```hello\nworld```
new SlackBuilder("abc").comment("hello\nworld") => abc >>> hello\nworld
```find more examples in test.js.