update types

This commit is contained in:
Eric Woodward 2024-01-27 12:14:47 -05:00
parent 397888b4a8
commit 2f0847eddf
4 changed files with 26 additions and 4 deletions

2
.gitignore vendored
View File

@ -133,4 +133,4 @@ dist
TODO.md
# Built libraries
/lib
/lib

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2023 Eric Woodward [https://www.itsericwoodward.com]
Copyright (c) 2024 Eric Woodward [https://www.itsericwoodward.com]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -0,0 +1,21 @@
# 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](https://git.itsericwoodward.com/eric/utils) on [my gitea instance](https://git.itsericwoodward.com/eric/) 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.parse`d contents of the file.

View File

@ -1,9 +1,10 @@
{
"name": "@itsericwoodward/utils",
"version": "0.1.0",
"description": "",
"version": "0.1.1",
"description": "A small collection of common libraries and functions the author likes to use in his Node applications.",
"main": "./lib/cjs/index.js",
"module": "./lib/esm/index.js",
"types": "./lib/esm/index.d.ts",
"files": [
"lib/"
],