1.1.1 • Published 4 months ago

@gehrbeck/gword v1.1.1

Weekly downloads
-
License
ISC
Repository
gitlab
Last release
4 months ago

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

FunctionDescription
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

4 months ago

1.1.0

4 months ago

1.0.0

4 months ago

0.0.13-alpha

4 months ago

0.0.12-alpha

4 months ago

0.0.11-alpha

4 months ago

0.0.10-alpha

4 months ago

0.0.9-alpha

4 months ago

0.0.8-alpha

4 months ago

0.0.7-alpha

4 months ago

0.0.6-alpha

4 months ago

0.0.3-alpha

4 months ago

0.0.2-alpha

4 months ago

0.0.1-alpha

4 months ago