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

https://github.com/stevancorre/lightsb

Simple TypeScript string builder
https://github.com/stevancorre/lightsb

node npm stringbuilder typescript

Last synced: 9 months ago
JSON representation

Simple TypeScript string builder

Awesome Lists containing this project

README

          





Light String Builder icon



Light String Builder


Simple light TypeScript string builder.















Download
Documentation
Quick start
Credits
License


## 📥 Download

```console
$ npm install lightsb
```


## 🏃 Quick start

```ts
const capacity: number = 7;
const builder: IStringBuilder = new StringBuilder("content", capacity);

builder.setCapacity(1024);

builder.append("first thing").append(420);
builder.appendRepeat("repeat 3 this times", 3);

builder.appendLine("new-line terminated")
builder.appendLineRepeat("3 lines here", 3);
builder.appendLines("line 1", "line 2", "...");
builder.appendEmptyLine();
builder.appendEmptyLines(42);

builder.setContent("content");
builder.clear();

const equals: boolean = builder.equals("other");
const isEmpty: boolean = builder.isEmpty();

const sub: string | undefined = builder.substring(0, 32);

const content: string | undefined = builder.toString();
```


## 📝 License

This project is MIT licensed.


## 👑 Credits

- Icon: Engineer icons created by Freepik - Flaticon
- README design: github.com/amitmerchant1990