rexar-tools
TypeScript icon, indicating that this package has built-in type declarations

2.8.0 • Public • Published

Rexar-Tools

Image Image

Some Useful Functions.

How to Install

npm:

npm i rexar-tools

yarn:

yarn add rexar-tools

2.8.0 news:

  • fixed esm bug.

Functions

Importing Module

CommonJS:

const RTools = require("rexar-tools").default

ESModule:

import RTools from "rexar-tools"
//or
const RTools = await import("rexar-tools/esm/index.mjs").then(m => m.default)

TypeScript:

import RTools from "rexar-tools"
//Type Methods
RTools.numberify("123")//Returns 123
RTools.stringify(123)//Returns "123"
RTools.dateify("2022-06-02")// Returns 2022-06-02T00:00:00.000Z
RTools.regexify(" ")//Returns / /
RTools.booleanify(1)//Returns true
RTools.bigintify(123)//Returns 123n
RTools.arrayify("foo bar")//Returns [ "foo bar" ]

RTools.isNumber("123")//Returns false
RTools.isNumber(RTools.numberify("123"))//Returns true
RTools.isString(123)//Returns false
RTools.isString(RTools.stringify(123))//Returns true
RTools.isDate("foo bar")//Returns false
RTools.isDate(RTools.dateify("2022-06-02"))//Returns true
RTools.isRegex(1221)//Returns false
RTools.isRegex(RTools.regexify(" "))//Returns true
RTools.isBoolean(5412)//Returns false
RTools.isBoolean(RTools.booleanify(1))//Returns true
RTools.isBigInt(512)//Returns false
RTools.isBigInt(RTools.bigintify(1))//Returns true
RTools.isObject(31)//Returns false
RTools.isObject({
    foo: "bar"
})//Returns true


//Date Methods
RTools.getDayWithText()//Returns What Today Is From Days
RTools.getMonthWithText()//Returns What ToMonth Is From Months
RTools.getWeek()//Returns What Week We Are.
RTools.getUTCWeek()//Returns the UTC Week We Are.

//Time Methods
await RTools.wait(1000)//If Used Inside a Function, Makes the Function Wait for Specified Time.
//or
RTools.wait(1000).then(v => v)//If Used Inside a Function, Makes the Function Wait for Specified Time.


//Request Methods
await RTools.npm("rexar-tools")//Assigns the data of the specified NPM package.
//or
RTools.npm("rexar-tools").then(v => v)//Assigns the data of the specified NPM package.
await RTools.yarn("rexar-tools")//Assigns the data of the specified Yarn package.
//or
RTools.yarn("rexar-tools").then(v => v)//Assigns the data of the specified Yarn package.

Package Sidebar

Install

npm i rexar-tools

Weekly Downloads

8

Version

2.8.0

License

MIT

Unpacked Size

13.2 kB

Total Files

11

Last publish

Collaborators

  • rexardev