# format-string-builder

> Simple JS string builder

Latest version **1.0.3** (published 2018-09-02) · ISC license · 0 weekly downloads

## Install

```sh
npm install format-string-builder
pnpm add format-string-builder
yarn add format-string-builder
bun add format-string-builder
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2018-09-02 |
| First published | 2018-09-02 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 68 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | romusulin |
| Maintainers | romusulin |

## Links

- npm: https://www.npmjs.com/package/format-string-builder
- Repository: https://github.com/romusulin/format-string-builder
- Homepage: https://github.com/romusulin/format-string-builder#readme
- Issues: https://github.com/romusulin/format-string-builder/issues
- npm.io page: https://npm.io/package/format-string-builder

## Recent versions

- 1.0.3 (latest) — 2018-09-02
- 1.0.2 — 2018-09-02
- 1.0.1 — 2018-09-02
- 1.0.0 — 2018-09-02

## README

# format-string-builder
Simple JS string builder

## Installation
    npm install format-string-builder

## Initialization
```javascript
var FormatStringBuilder = require("format-string-builder");
const Builder = new FormatStringBuilder();
```
## Functions
### constructor(str: string, nl: string)
Sets the string and new line delimiter. If none are supplied, uses empty string and "\n" as delimiter.
```javascript
const Builder = new FormatStringBuilder("Test string");
```

### append(str: string
Appends the given string to builder.
```javascript
Builder.append("I forgot this part");
```

### appendLn(str: string)
Appends the given string to builder with a newline.
```javascript
Builder.appendLn("I am followed by a new line");
```

### format(fullStr: str, arg1: str, arg2: str...)
Replaces placeholders with given arguments.
```javascript
Builder.format("Hello {0}, my name is {1} {2}", "reader", "Uncle", "Bob");
```

The string is formatted as:

    "Hello reader, my name is Uncle Bob"

### clear()
Clears the string.

```javascript
Builder.clear();
```

### toString()
Returns the built string.
```javascript
const builtString = Builder.toString();
```
## Properties
### newline
Returns the set newline delimiter.
### length
Returns the length of the built string.
### lines
Returns a split string array.

---
_Source: https://npm.io/package/format-string-builder · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
