My personal collection of typescript utility functions.
Go to file
Eric Woodward c30c09adaf moar TS fixes 2024-01-27 20:42:43 -05:00
__tests__ Initial commit 2024-01-27 01:25:35 -05:00
lib moar TS fixes 2024-01-27 20:42:43 -05:00
src moar TS fixes 2024-01-27 20:42:43 -05:00
.editorconfig Initial commit 2024-01-27 01:25:35 -05:00
.eslintrc.cjs Initial commit 2024-01-27 01:25:35 -05:00
.gitattributes Initial commit 2024-01-27 01:25:35 -05:00
.gitignore fix the broken package 2024-01-27 16:29:33 -05:00
.jshintrc Initial commit 2024-01-27 01:25:35 -05:00
.prettierignore Initial commit 2024-01-27 01:25:35 -05:00
LICENSE update types 2024-01-27 12:14:47 -05:00
README.md update README 2024-01-27 12:21:23 -05:00
TODDO.md Initial commit 2024-01-27 01:25:35 -05:00
jest.config.js Initial commit 2024-01-27 01:25:35 -05:00
jsconfig.json Initial commit 2024-01-27 01:25:35 -05:00
package-lock.json add missing dependencies 2024-01-27 17:40:42 -05:00
package.json moar TS fixes 2024-01-27 20:42:43 -05:00
tsconfig-cjs.json initial (real) commit 2024-01-27 01:54:27 -05:00
tsconfig.json initial (real) commit 2024-01-27 01:54:27 -05:00

README.md

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 __dirname and __filename, as with CJS Node.
    • Returns: { __dirname: string, __filename: string }
  • getTime()
    • Returns: the current time in a standardized format.
  • log(...msg: unknown[])
    • Prints the contents of msg to the console with my preferred formatting.
  • readJsonIfExists(filePath: string | URL)
    • Reads the contents of the JSON or JSON5 file at indicated filePath.
    • Returns: the JSON.parsed contents of the file.