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
- Host: GitHub
- URL: https://github.com/stevancorre/lightsb
- Owner: stevancorre
- License: mit
- Created: 2022-03-09T22:56:17.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-05-23T20:03:02.000Z (over 3 years ago)
- Last Synced: 2025-03-18T16:12:08.720Z (10 months ago)
- Topics: node, npm, stringbuilder, typescript
- Language: TypeScript
- Homepage:
- Size: 111 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
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