{"id":49444669,"url":"https://github.com/tbhvishal/js-toolbox","last_synced_at":"2026-04-29T21:36:55.123Z","repository":{"id":319061741,"uuid":"1077376516","full_name":"tbhvishal/js-toolbox","owner":"tbhvishal","description":"Lightweight JavaScript utilities toolkit: helpers, snippets, and productivity tools. ESM, Node.js, TypeScript-friendly, zero dependencies. Arrays, strings, dates, async, functional programming - perfect for beginners and pros","archived":false,"fork":false,"pushed_at":"2025-10-16T09:43:22.000Z","size":436,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-17T11:30:16.578Z","etag":null,"topics":["beginner-friendly","best-practices","code-snippets-javascript","copy-paste","developer-tools","esm","functional-programming","hacktoberfest","helpers","javascript","library","lightweight","nodejs","npm-package","productivity-tools","snippets","utilities","utils","vanilla-js","zero-dependencies"],"latest_commit_sha":null,"homepage":"","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/tbhvishal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-16T07:05:42.000Z","updated_at":"2025-10-16T09:56:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"926e3c8e-ab07-449e-b9a8-097ca92e2d01","html_url":"https://github.com/tbhvishal/js-toolbox","commit_stats":null,"previous_names":["tbhvishal/js-toolbox"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/tbhvishal/js-toolbox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tbhvishal%2Fjs-toolbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tbhvishal%2Fjs-toolbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tbhvishal%2Fjs-toolbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tbhvishal%2Fjs-toolbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tbhvishal","download_url":"https://codeload.github.com/tbhvishal/js-toolbox/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tbhvishal%2Fjs-toolbox/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32445542,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T20:22:27.477Z","status":"ssl_error","status_checked_at":"2026-04-29T20:22:26.507Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["beginner-friendly","best-practices","code-snippets-javascript","copy-paste","developer-tools","esm","functional-programming","hacktoberfest","helpers","javascript","library","lightweight","nodejs","npm-package","productivity-tools","snippets","utilities","utils","vanilla-js","zero-dependencies"],"created_at":"2026-04-29T21:36:53.807Z","updated_at":"2026-04-29T21:36:55.118Z","avatar_url":"https://github.com/tbhvishal.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"#  js-toolbox  ⚡\n\n![Node Version](https://img.shields.io/badge/node-%3E%3D18-brightgreen)\n![License](https://img.shields.io/badge/license-MIT-blue)\n![Zero Dependencies](https://img.shields.io/badge/dependencies-0-success)\n![GitHub Stars](https://img.shields.io/github/stars/tbhvishal/js-toolbox?style=social)\n![GitHub Issues](https://img.shields.io/github/issues/tbhvishal/js-toolbox)\n![Commits](https://img.shields.io/github/commit-activity/m/tbhvishal/js-toolbox)\n\n\u003e  A  small,  zero-dependency  JavaScript  toolbox  for  everyday  tasks  -  simple,  readable,  and  copy-paste  friendly.  ✨\n\n##  ✨  Features\n\n-  🚀  **Zero  dependencies**  -  lightweight  and  fast\n-  📦  **40+  utilities**  -  covering  strings,  numbers,  arrays,  dates,  async,  and  more\n-  🌐  **Works  everywhere**  -  Node  18+  (ESM)  and  browser-friendly\n-  📝  **JSDoc  comments**  -  full  autocomplete  support\n-  🔧  **Built-in  CLI**  -  use  utilities  from  the  command  line\n-  ✅  **Well-tested**  -  comprehensive  test  suite  included\n\n## 🤔  Why Another Utility Library?\n\nUnlike bloated alternatives:\n- **Lodash** = 72KB minified, 500+ functions you'll never use\n- **js-toolbox** = \u003c5KB total, only what you need\n\nPerfect for:\n- ✅ Quick scripts and prototypes\n- ✅ Learning JavaScript patterns\n- ✅ Projects that need to stay lean\n- ✅ Copy-pasting one function without installing a library\n\n##  📦  Installation\n\n```bash\n# Clone the repo\ngit  clone  https://github.com/tbhvishal/js-toolbox.git\n\n# Or copy individual functions directly into your project\n```\n\n##  🚀  Quick  Start\n\n-  **Use  in  Node.js:**\n\n```js\nimport  {  strings,  numbers  }  from  './src/index.js';\n\nconsole.log(strings.slugify('Hello  World!'));  //  →  \"hello-world\"\nconsole.log(numbers.randInt(1,  6));            //  →  random  number  1-6\nconsole.log(numbers.toCurrency(1234.56));       //  →  \"$1,234.56\"\n```\n\n-  **Use  via  CLI:**\n\n```bash\nnode  ./bin/js-toolbox.js  strings  slugify  \"Hello  World!\"\n#  Output:  hello-world\n```\n\n-  **Copy  \u0026  Paste:**\n  \n  Just  grab  the  function  you  need  from  `src/`  and  paste  it  into  your  project.  No  installation  required!\n\n##  📚  Modules\n\n### 🔢  Numbers\n`clamp`, `between`, `randInt`, `randFloat`, `sum`, `avg`, `median`, `toCurrency`, `round`, `percentage`, `isEven`, `isOdd`\n\n\u003cdetails\u003e\n\u003csummary\u003eShow examples\u003c/summary\u003e\n\n```js\nimport * as num from './src/numbers.js';\n\nnum.clamp(150, 0, 100);           // 100\nnum.randInt(1, 6);                // Random 1-6 (dice roll)\nnum.toCurrency(1234.56);          // \"$1,234.56\"\nnum.percentage(25, 200);          // 12.5\nnum.median([1, 2, 3, 4, 5]);      // 3\n```\n\u003c/details\u003e\n\n### 📝  Strings\n`capitalize`, `titleCase`, `kebabCase`, `slugify`, `truncate`, `pad`, `stripAnsi`, `reverse`, `camelCase`, `snakeCase`, `repeat`, `escapeHtml`\n\n\u003cdetails\u003e\n\u003csummary\u003eShow examples\u003c/summary\u003e\n\n```js\nimport * as str from './src/strings.js';\n\nstr.slugify('Hello World!');           // \"hello-world\"\nstr.titleCase('hello world');          // \"Hello World\"\nstr.truncate('Long text here', 10);    // \"Long te...\"\nstr.camelCase('hello-world');          // \"helloWorld\"\nstr.escapeHtml('\u003cscript\u003ealert(\"xss\")\u003c/script\u003e');  // Safe HTML\n```\n\u003c/details\u003e\n\n### 📅  Dates\n`formatDate`, `fromNow`, `addDays`, `isSameDay`, `parseISO`, `startOfDay`, `endOfDay`, `daysBetween`\n\n\u003cdetails\u003e\n\u003csummary\u003eShow examples\u003c/summary\u003e\n\n```js\nimport * as dates from './src/dates.js';\n\ndates.fromNow(new Date('2024-01-01'));    // \"289d ago\"\ndates.addDays(new Date(), 7);             // Date 7 days from now\ndates.formatDate(new Date());             // \"10/16/2025\"\ndates.daysBetween('2024-01-01', '2024-12-31');  // 365\n```\n\u003c/details\u003e\n\n### 📊  Arrays\n`unique`, `chunk`, `sample`, `shuffle`, `groupBy`, `flatten`, `compact`, `first`, `last`, `take`, `range`, `partition`\n\n\u003cdetails\u003e\n\u003csummary\u003eShow examples\u003c/summary\u003e\n\n```js\nimport * as arr from './src/arrays.js';\n\narr.unique([1, 2, 2, 3]);             // [1, 2, 3]\narr.chunk([1, 2, 3, 4], 2);           // [[1,2], [3,4]]\narr.range(5);                         // [0, 1, 2, 3, 4]\narr.shuffle([1, 2, 3]);               // Random order\narr.partition([1,2,3,4], x =\u003e x % 2); // [[1,3], [2,4]]\n```\n\u003c/details\u003e\n\n### ⏱️  Async\n`delay`, `sleep`, `withTimeout`, `retry`, `memoizeAsync`, `simpleQueue`, `debounce`, `throttle`\n\n\u003cdetails\u003e\n\u003csummary\u003eShow examples\u003c/summary\u003e\n\n```js\nimport * as async from './src/async.js';\n\nawait async.delay(1000);              // Wait 1 second\nawait async.retry(() =\u003e fetchAPI(), { tries: 3 });\nconst debouncedSave = async.debounce(saveData, 500);\n```\n\u003c/details\u003e\n\n### 📁  File System (Node only)\n`readJSON`, `writeJSON`, `ensureDir`, `listFiles`\n\n### 🌐  HTTP\n`get`, `post` - using fetch with timeout + retries\n\n\u003e 💡  **Tip:**  See  examples  in  each  file  and  comprehensive  tests  in  `tests/`.\n\n##  🧪  Testing\n\nRun  all  tests:\n\n```bash\nnpm  test\n```\n\nAll  utilities  are  tested  with  Node's  built-in  `assert`  module.\n\n##  🤝  Contributing\n\nWant  to  add  a  utility  or  fix  a  bug?  Awesome!  \n\n-  Keep  it  simple  and  readable\n-  Add  a  test  case  in  `tests/`\n-  Update  the  README  with  an  example\n-  Check  out  [`CONTRIBUTING.md`](./CONTRIBUTING.md)  for  full  guidelines\n\n**💬 Have questions?** Check out [Discussions](https://github.com/tbhvishal/js-toolbox/discussions) or open an [Issue](https://github.com/tbhvishal/js-toolbox/issues)!\n\n##  📄  License\n\nMIT  ©  [tbhvishal](https://github.com/tbhvishal)\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n**Made  with  ❤️ for  developers**\n\n⭐  Star  this  repo  if  you  find  it  useful!  ⭐\n\n\u003c/div\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftbhvishal%2Fjs-toolbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftbhvishal%2Fjs-toolbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftbhvishal%2Fjs-toolbox/lists"}