1.3.8 • Published 5 years ago
btxt v1.3.8
Btxt Module
Btxt is a very-tiny module for more features to improve your Style
npm i btxt@latest
Properties
- btxt Method Convert a String into a Customized String
- Argument
txt
String ReturnsString
const b = require("btxt");
b.btxt("Hello World");
//"Ħȩŀḹ๑ Ŵ๏ṝḹժ!"
- compare Method Compare a String with an Array of string to find the most closed value
- Arguments
word
StringtoCompareWith
Array ReturnsString
||null
Incase there was no any similar value
const b = require("btxt");
b.compare("hulle wurld", ["hello", "boo", "Hello world", "baz", "ello world"])
//"Hello world"
- toLatin Method Calculate a number into Latin
- Argument
number
Number ReturnsString
const b = require('btxt');
b.toLatin(1540);
//"MDXL"
- keyGenerator Class Generate a random key that contains characters and numbers
- Argument
keyLength
Number Optional default =15
You can also set the key length directly via the prop.keyLength
ReturnsString
const b = require('btxt');
var gen = new b.keyGenerator();
gen.generate();
//"634h9jTd92X9d2M"
- calculateLatin Method Calculate a latin number
- Argument
str
String, Latin Number ReturnsNumber
Throw an Error if the number was invalid
const b = require('btxt');
b.calculateLatin("MDXIV")
//1514
- between Method
Gets a string between Argument
qu1
andqu2
- Arguments
str
String.qu1
String. Default ="
qu2
String. Default =qu2
Returns Array | null. e.g.
const b = require('btxt');
b.between("{Hello}{World}{", "{", "}");
// ["Hello", "World"]
Browser Version
<script src='https://raw.githubusercontent.com/LeeeRoux/btxt/master/bin/btxt-browser.js'></script>