@betadv/placeholders-manager

1.0.2 • Public • Published

TABLE OF CONTENTS


INTRODUCTION


This package provides a simple function to use Placeholders in your strings, wheter it is for a Translation System,wheter it is for something completely different, this will do the job for sure!

PREREQUISITES


This package has no requirements and is very light, should be usable across all Node.JS Versions as far as I'm aware.

INSTALLATION


To Install the package just run in your Console:

Using NPM:

npm install @betadv/placeholders-manager

Using YARN:

yarn add @betadv/placeholders-manager

USAGE


Javascript Example:

const Placeholders = require("@betadv/placeholders-manager");
// Variable Name will be the Function, so you can name this however you want

const template = "My name is {{ username }} and this package is a {{ rating }}/10!";
// This is here just to make the Snippet readable

const MyCoolString = Placeholders(template, { rating: 10, username: "BetaDv" });
// Core Function: Placeholders(text, placeholders);

console.log(MyCoolString);
// RESULT:
// My name is BetaDv and this package is a 10/10!

Configurable Parameters:

  • The text you use that you want to change.
  • The placeholders which will affect the text.

Package Sidebar

Install

npm i @betadv/placeholders-manager

Weekly Downloads

3

Version

1.0.2

License

ISC

Unpacked Size

2.49 kB

Total Files

4

Last publish

Collaborators

  • betadv