diff --git a/.gitignore b/.gitignore index 2073415..fb2775d 100644 --- a/.gitignore +++ b/.gitignore @@ -133,4 +133,4 @@ dist TODO.md # Built libraries -/lib \ No newline at end of file +/lib diff --git a/LICENSE b/LICENSE index 587acd5..3ef638a 100644 --- a/LICENSE +++ b/LICENSE @@ -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 diff --git a/README.md b/README.md index e69de29..1282160 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/package.json b/package.json index 7c8922f..a7d0cc9 100644 --- a/package.json +++ b/package.json @@ -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/" ],