displacer
v0.0.3
Published
It allows you to displace the entered text
Downloads
2
Readme
WARNING
This npm module is still in beta. Errors may occur!
USAGE
Usage of normal displacer
const { displacer, displacerConfig } = require("displacer");
const dpConfig = displacerConfig({
prefix: ["[]"],
languagePaths: {
en: null
},
lang: "en"
}) //Default configs
displacer(`[botName] is the best bot in the [world]`, {
botName: "Alive",
world: "🌍"
}, dpConfig) //You don't have to enter configs. (Default configs are used.)
//output -> Alive is the best bot in the 🌍
Usage of language displacer
const { displacer, displacerConfig } = require("displacer");
const en = require("./en.json");
const tr = require("./tr.json");
/*
en.json:
{
"test": "Test1"
}
tr.json:
{
"test": "Test2"
}
*/
const dpConfig = displacerConfig({
prefix: ["[]", "%%"],
languagePaths: {
en: en, //Just enter JSON files!
tr: tr
},
lang: "en" //Language to access
})
displacer(`[displaceLang]`, {
displaceLang: "test" //Changing languages can only be done using this (displaceLang). (For now)
}, dpConfig) //You don't have to enter configs. (Default configs are used.)
//output -> test1