cf8f8b3e3844c5bc2a7ca50956ecaccc1f1ea543
ItsEricWoodward's Utils
A small collection of common libraries and functions I like to use in my Node applications.
I figure that publishing them in a public repo on my gitea instance will make them easier to use.
The functions exported by this library are:
- convertCamelToUpperSnakeCase(
str: string)- Converts textLikeThis (or TextLikeThis) to TEXT_LIKE_THIS.
- Returns: Converted version of
str
- getDirname()
- Reads and returns variables
__dirnameand__filename, as with CJS Node. - Returns: {
__dirname: string,__filename: string }
- Reads and returns variables
- getTime()
- Returns: the current time in a standardized format.
- log(
...msg: unknown[])- Prints the contents of
msgto the console with my preferred formatting.
- Prints the contents of
- readJsonIfExists(
filePath: string | URL)- Reads the contents of the JSON or JSON5 file at indicated
filePath. - Returns: the
JSON.parsed contents of the file.
- Reads the contents of the JSON or JSON5 file at indicated
Description
Languages
TypeScript
95.8%
JavaScript
4.2%