This repository has been archived by the owner on Oct 9, 2020. It is now read-only.
Releases: Sv443/JSLib-npm
Releases · Sv443/JSLib-npm
Release 1.9.4
- Fixed invalid usage of the "SIGKILL" signal in
jsl.softShutdown()
(GitHub issue #49) - Added function
jsl.randomItem()
that returns a random item of an array
Release 1.9.3
- Decreased size of package by adding some files to the
.npmignore
(GitHub issue #45) - Fixed memory leak issues as all events in
jsl.pause()
are now correctly unregistered (GitHub issue #43) - Fixed the JSDoc documentation comments for
jsl.seededRNG.generateSeededNumbers()
and some other functions (GitHub issue #44) - Improved handling of the two separate
package.json
files, for NPM and GPR (GitHub issue #47) - Modified the
.editorconfig
a bit
Release 1.9.2
Changes / Improvements:
- Fixed some minor docs issues
- Added Promise return to
jsl.downloadFile()
andjsl.readdirRecursive()
- Made "Exit" text localizable in
jsl.MenuPrompt
Release 1.9.1
Fixed event listeners not being correctly unregistered in jsl.pause()
which resulted in unexpected behavior when running the function multiple times.
Release 1.9.0
- New Features:
- Added function
jsl.removeDuplicates()
to remove duplicate entries in an array - Added function
jsl.pause()
to wait until user confirmation before continuing code execution - Added function
jsl.inDebugger()
to check if the process is currently running in a debugger
- Added function
- Improvements / Fixes:
jsl.unused()
now has a rest parameter instead of a single parameter- Added a localization property to
jsl.MenuPrompt
to enable it for being translated - Fixed a bug in
jsl.MenuPrompt
by ensuring that the raw mode of the stdin is always set to true - Massively improved unit tests
- Added a code coverage report
Release 1.8.4
Release 1.8.3
- Fixed typo in the JSDoc comment for "jsl.randRange()"
- Fixed JSDoc typedefs for MenuPrompt (#19)
- Fixed "directory not found" error in the unit test script (#17)
- Removed function "jsl.runUnitTests()"
- Added GitHub actions scripts to automate building and publishing
- Added option to automatically submit a menu in MenuPrompt after typing a single character (#26)
(If you are looking for Release 1.8.2, I had to take it down due to an error while publishing that caused a version mismatch)
Release 1.8.1
Fixed issues with the GitHub package registry
Release 1.8.0
- new features:
- function "jsl.seededRNG.generateSeededNumbers(count, seed)" to generate "random" numbers based on a passed seed
- function "jsl.seededRNG.generateRandomSeed(digitCount)" to generate a random seed to be used in "jsl.generateSeededNumbers()"
- function "jsl.seededRNG.validateSeed(seed)" to check whether or not a seed is valid
- function "jsl.mapRange(value, range_1_min, range_1_max, range_2_min, range_2_max)" to transform a value from one numerical range to another
- function "jsl.downloadFile(url, destPath, options)" to download a file from a URL
- function "jsl.unused(any_var)" to indicate an unused variable to a linter
- function "jsl.replaceAt(input: str, index: number, replacement: str)" to replace a character at the specified index of a string with a replacement
- function "jsl.randomizeArray(array: array)" to randomize the indexes of the items of an array
- object "colors" to make it easier to add colors to the console output - this will replace "jsl.consoleColor()"
- class "MenuPrompt" for an interactive menu (directly in the CLI) - methods:
- "open()" to open the prompt
- "addMenu()" to add a new menu to the prompt
- "validateMenu()" to check whether a menu is invalid
- "currentMenu()" to get the current menu index
- "close()" to prematurely close the prompt and get the results
- "result()" to prematurely get the results of the prompt (without closing it)
- added unit tests for every function, class and object. They can be run with "npm test" or "node unittest"
- improvements / fixes:
- added support for ESLint (use "npm i --save-dev" and then "npm run lint")
- improved time measurement system for "jsl.ping()"
- improved the background stuff in "jsl.ping()" to improve performance
- added "contentType" property to "jsl.ping()"'s promise callback
- edited a bunch of functions and methods to throw an error instead of returning it as a string, which could've caused unwanted and unpredictable behavior
- put the UUID generation inside an object, renamed it and added four new ones:
- "generateUUID.hexadecimal(format: str, upperCase: bool)" [0-9,a-f/A-F]
- "generateUUID.alphanumerical(format: str, upperCase: bool)" [0-9,a-z/A-Z]
- "generateUUID.decimal(format: str)" [0-9]
- "generateUUID.binary(format: str)" [0-1]
- "generateUUID.custom(format: str, possibleValues: str)" [Custom]
- added "contributors" and "documentation" properties to the "jsl.info" object
- removed the signal "SIGKILL" from the shutdown prevention functions as "SIGKILL" is intended as a signal that forces a process to be exited no matter what
- rewrote the entire documentation, I'm crying rn
- restructured the entire script to separate each function into its own file
- fixed "isEmpty()"'s object-with-length-0-detection
Release 1.7.0 - New functions, dynamic progress bar, minor fixes
- Fixed #9
- Fixed #10
- fixed typo in "readme.md"
- added "ProgressBar" class to create a dynamic progress bar
- added function "jsl.readdirRecursive(folder, callback(err, result){})" to read a folder and its subfolders asynchronously
- added function "jsl.readdirRecursiveSync(folder)" to read a folder and its subfolders synchronously
- added function "jsl.readableArray(array, separators, lastSeparator)" to make an array more easily human-readable
- split the package up into three separate files
- removed all dependencies because they are either included by default or their effect was easily recreatable in vanilla JS