1.1.1 • Published 2 years ago
@gehrbeck/gword v1.1.1
GWord – The GehrBeck Text Manipulation Helper
Why
We missed some functions in the default strings in JavaScript/TypeScript. That's why this library was created. There will be updates bringing more features soon.
Usage Guide
import using
import {GWord} from '@gehrbeck/gword';
const gword = require('@gehrbeck/gword');GWord provides a fluent API which means you can chain multiple commands after each other. There are also two ways to create an instance. See following examples for a better understanding.
const instance = new GWord('your-base-string');GWord.create('your-base-string');After creating your instance you can call whatever function you like and retrieve
the result with the get(); function.
const tag: string = GWord.create('maybeATag').wrapInDiamondBrackets().get();Functions Overview
| Function | Description |
|---|---|
| create(string) | Static function to create an instance of GWord. |
| removeAll(string) | Removes all occurrences of a string in the GWord. |
| replaceAll(target, replacement) | Replaces all occurrences of a string with the given replacement. |
| wrapIn(string) | Wraps the GWord in a given string. |
| wrapInCurlyBrackets() | Wraps the GWord in curly brackets. |
| wrapInDiamondBrackets() | Wraps the GWord in diamond brackets. |
| prefixWith(string) | Prefixes the GWord with a given string. |
| postfixWith(string) | Postfixes the Gword with a given string. |
| escapeHtmlEntities() | Escapes the most important html entities. |
| removeLastChar() | Removes the last character |
| removeFirstChar() | Removes the first character |
| get() | Returns the final string after transformation. |
1.1.1
2 years ago
1.1.0
2 years ago
1.0.0
2 years ago
0.0.13-alpha
2 years ago
0.0.12-alpha
2 years ago
0.0.11-alpha
2 years ago
0.0.10-alpha
2 years ago
0.0.9-alpha
2 years ago
0.0.8-alpha
2 years ago
0.0.7-alpha
2 years ago
0.0.6-alpha
2 years ago
0.0.3-alpha
2 years ago
0.0.2-alpha
2 years ago
0.0.1-alpha
2 years ago