@betadv/placeholders-manager
v1.0.2
Published
This package is made to simplify the use of Placeholders in Strings, good for translation systems and such.
Downloads
4
Maintainers
Readme
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.