{"id":28456700,"url":"https://github.com/10xengineersqualityprogramming/importantextremelyusefulclasses.js","last_synced_at":"2025-06-29T10:30:56.375Z","repository":{"id":296035164,"uuid":"992120551","full_name":"10xEngineersQualityProgramming/ImportantExtremelyUsefulClasses.js","owner":"10xEngineersQualityProgramming","description":"Extremely useful classes to use in every nodejs project!","archived":false,"fork":false,"pushed_at":"2025-05-28T16:52:04.000Z","size":32,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-06T23:08:37.682Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/10xEngineersQualityProgramming.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-28T16:44:32.000Z","updated_at":"2025-05-28T16:52:07.000Z","dependencies_parsed_at":"2025-05-28T17:53:06.980Z","dependency_job_id":"0de3a95c-0771-485b-98ef-af9d7452c929","html_url":"https://github.com/10xEngineersQualityProgramming/ImportantExtremelyUsefulClasses.js","commit_stats":null,"previous_names":["10xengineersqualityprogramming/importantextremelyusefulclasses.js"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/10xEngineersQualityProgramming/ImportantExtremelyUsefulClasses.js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/10xEngineersQualityProgramming%2FImportantExtremelyUsefulClasses.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/10xEngineersQualityProgramming%2FImportantExtremelyUsefulClasses.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/10xEngineersQualityProgramming%2FImportantExtremelyUsefulClasses.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/10xEngineersQualityProgramming%2FImportantExtremelyUsefulClasses.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/10xEngineersQualityProgramming","download_url":"https://codeload.github.com/10xEngineersQualityProgramming/ImportantExtremelyUsefulClasses.js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/10xEngineersQualityProgramming%2FImportantExtremelyUsefulClasses.js/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262577693,"owners_count":23331470,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-06T23:08:40.148Z","updated_at":"2025-06-29T10:30:56.367Z","avatar_url":"https://github.com/10xEngineersQualityProgramming.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EXTREMELY USEFUL CLASSES\nThis library provides extremely useful classes for javascript.\n\n## installatiion\ninstall with yarn:\n```bash\n$ yarn add important-extremely-useful-classes\n```\n\nor npm:\n```bash\n$ npm i important-extremely-useful-classes\n```\n\n## `Logger`\nThis is useful for when you want logs but you don't want them to show if logging is not enabled, and you don't want an if statement everytime you need to log something when enableLogging is enabled.\n\n`new Logger(loggingEnabled?: boolean);`\n\nUsage:\n```js\n\nconst { Logger } = require('important-extremely-useful-classes')\nfunction logHiIfLoggingIsEnabled(enableLogging) {\n  var logger = new Logger(enableLogging)\n  logger.log('Hi')\n}\n\nlogHiIfLoggingIsEnabled(false) // no output\nlogHiIfLoggingIsEnabled(true) // Output: Hi\n```\n\n## `SuccessorHelper`\nThis is a helper to get the successor of a number.\n\nUsage:\n```js\nconst { SuccessorHelper } = require('important-extremely-useful-classes')\nconst { s } = new SuccessorHelper()\n\nconsole.log(s(1)) // 2\nconsole.log(s(32767)) // 32768\nconsole.log(s(53)) // 54\n```\n\n## `TernaryCompare`\nClass alternative for ternary statements. (NOT ES5 ALTERNATIVE AS IT USES TERNARY STATEMENT IN THE CODE OF THE CLASS!!!!!!!!!!)\n\nUsage:\n```js\n\n// Old\nfunction hiorbye(sayBye) {\n  console.log(sayBye ? 'bye' : 'hi')\n}\nconsole.log(hiorbye(true)) // bye\nconsole.log(hiorbye(false)) // hi\n\n// New\nconst { TernaryCompare } = require('important-extremely-useful-classes')\nfunction hiorbye(sayBye) {\n  console.log(new TernaryCompare(sayBye, 'bye', 'hi').compare())\n}\nconsole.log(hiorbye(true)) // bye\nconsole.log(hiorbye(false)) // hi\n\n```\n\n## `ObjectOrFunctionParemeterName`\n\nTo refer to an object's property's key name semantically with `isTrue`.\n\n```js\n\n// Old\nconst isTrue = require('is-true')\n\nconsole.log(isTrue({ value: true }, 'value')) // true\nconsole.log(isTrue({ value: 'sdfsdfsdf'}, 'value')) // false\n\n// New\n\nconst isTrue = require('is-true')\nconst { ObjectOrFunctionParemeterName } = require('important-extremely-useful-classes')\n\nconsole.log(isTrue({ value: true }, new ObjectOrFunctionParemeterName('value').getName())) // true\nconsole.log(isTrue({ value: 'sdfsdfsdf'}, new ObjectOrFunctionParemeterName('value').getName())) // false\n\n```\n\n## `CLIColorInstance` and `PicoColorInstance`\n\nidk what the point of this is but its important okay?\n\n```js\n// old\n\nvar clc_ = require('cli-color')\nvar picocolor_ = require('picocolors')\n\n\n// new\n\nvar useGarbage = require('garbage')\nvar { CLIColorInstance, PicoColorInstance } = require(\"important-extremely-useful-classes\")\n\nvar clc = new CLIColorInstance(useGarbage).getInstance() // you have to always pass garbage into clicolorinstance\nvar clc__ = clc\nvar clc_ = clc__\n\nvar picocolor = new PicoColorInstance(useGarbage).getInstance() // you have to always pass garbage into picocolorinstance too\nvar picocolor__ = picocolor\nvar picocolor_ = picocolor__\n```\nyeah i have no idea why\n\n## `NilGuardedExecutor`\n\nExecutes a function only if **none** of the arguments are `null` or `undefined`.  \nPrevents you from having to write `if (a != null \u0026\u0026 b != null \u0026\u0026 c != null)` for every one of your args.\n\nUsage:\n```js\nconst { NilGuardedExecutor } = require('important-extremely-useful-classes')\n\nfunction addThreeNumbers(a, b, c) {\n  return a + b + c\n}\n\nconst guarded = new NilGuardedExecutor(addThreeNumbers, 1, 2, 3)\nconsole.log(guarded.execute()) // 6\n\nconst guardedFail = new NilGuardedExecutor(addThreeNumbers, 1, null, 3)\nconsole.log(guardedFail.execute()) // undefined (because one arg was null)\n\n```\n\n## contributing\n\n\nIF YOU HAVE MORE USEFUL CLASSES, FEEL FREE TO FILE ISSUE OR PR ON \u003ca href=\"https://github.com/10xEngineersQualityProgramming/ImportantExtremelyUsefulClasses.js\"\u003eTHE GITHUB REPO\u003c/a\u003e!!!!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F10xengineersqualityprogramming%2Fimportantextremelyusefulclasses.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F10xengineersqualityprogramming%2Fimportantextremelyusefulclasses.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F10xengineersqualityprogramming%2Fimportantextremelyusefulclasses.js/lists"}