0.0.1 • Published 3 years ago
@cyberghxstuwu/utils v0.0.1
This is a shitty package for my own use.
@cyberghxst/utils
Install
npm i @cyberghxst/utils
Methods
- booleanify
- isBool
- printWarn
Setup
const Util = require('@cyberghxst/utils');
const util = new Util();
Examples
.booleanify()
Params: (text) This method converts certain strings to booleans. Example: '1' to true, 'yes' to true, 'true' to true
util.booleanify('yes'); //returns true
util.booleanify('no'); //returns false
.isBool()
Params: (text) Checks if the provided text is a boolean. Example:
util.isBool('yes'); //returns true
util.isBool('hello'); //returns false
.print()
Params: (text, color) This is a bullshit console.log but renamed
Available colors: |----------------------| | black | | red | | green | | bold | | sky | | violet | | cyan | | grey | | pink | | blue |
Example:
util.print('Hello', 'cyan') //Logs 'Hello'.
.printWarn()
Params: (text) This is the print method, but in red color. Example:
util.printWarn('Err') //Logs 'Err'.
0.0.1
3 years ago