stubby.ts
v1.3.2
Published
A simple and powerful module for JavaScript
Downloads
23
Maintainers
Readme
stubby.ts
It's powerful and full laziness module for JavaScript and TypeScript.
Docs
import { RandomNumber } from "stubby.ts";
let rand = RandomNumber(10, 100);
console.log(rand); // now it will take random numbers between 10 to 100
import { RandomArray } from "stubby.ts";
// first example.
let fruits = [
"Apple",
"Pineapple",
"Orange",
"Strawberry",
"Mango",
"Cherry"
];
let randomFruits = RandomArray(fruits);
console.log(randomFruits); // it will send the array value randmly
// second example
let names = [
{
name: "Arif"
},
{
name: "Afrin"
}
];
let randomNames = RandomArray(names);
console.log(randomNames.name); // it will send the array json object value randomly
import { SmallNumber } from "stubby.ts";
let num = "143";
let digits = num.length + 1;
console.log(SmallNumber(num, digits)) // it wil print superscript numbers like ⁰¹²³⁴⁵⁶⁷⁸⁹
import { SystemInfo } from "stubby.ts";
console.log(SystemInfo().memory());
console.log(SystemInfo().memoryUsage());
console.log(SystemInfo().cpuUsage());
console.log(SystemInfo().cores());
console.log(SystemInfo().cpuBrand());
console.log(SystemInfo().uptime());
import { Replace } from 'stubby.ts';
const paragraph = `
%boyname% loves %girlname%, but %girlname% doesn't know yet.
`;
const replacements = {
'%boyname%': 'Arif',
'%girlname%': 'Afrin'
};
const loveStory = Replace(paragraph, replacements);
console.log(loveStory);
Thanks✨
Have a great day!😊