{"id":36502169,"url":"https://github.com/handyscript/handyscript","last_synced_at":"2026-01-12T02:23:29.939Z","repository":{"id":174935859,"uuid":"653018139","full_name":"handyscript/handyscript","owner":"handyscript","description":"A set of useful javascript modules that extends the javascript core context.","archived":false,"fork":false,"pushed_at":"2024-01-15T14:31:35.000Z","size":1774,"stargazers_count":4,"open_issues_count":8,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-01-21T20:07:18.850Z","etag":null,"topics":["handy-script","handyscipt","javascript","library","modules","new-topic","typescript"],"latest_commit_sha":null,"homepage":"https://handyscript.tech","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc-by-sa-4.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/handyscript.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-06-13T08:53:18.000Z","updated_at":"2024-01-21T20:07:18.851Z","dependencies_parsed_at":"2023-10-01T12:23:34.607Z","dependency_job_id":null,"html_url":"https://github.com/handyscript/handyscript","commit_stats":null,"previous_names":["handyscript/handyscript"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/handyscript/handyscript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/handyscript%2Fhandyscript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/handyscript%2Fhandyscript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/handyscript%2Fhandyscript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/handyscript%2Fhandyscript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/handyscript","download_url":"https://codeload.github.com/handyscript/handyscript/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/handyscript%2Fhandyscript/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28332165,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"online","status_checked_at":"2026-01-12T02:00:08.677Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["handy-script","handyscipt","javascript","library","modules","new-topic","typescript"],"created_at":"2026-01-12T02:23:27.605Z","updated_at":"2026-01-12T02:23:29.933Z","avatar_url":"https://github.com/handyscript.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\" width=\"100%\"\u003e\n\u003cimg width=\"100%\" alt=\"Handy Script Cover\" src=\"static/assets/HSCover.png\"/\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eHandy Script\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\nA set of useful javascript modules that makes the javascript development context easier\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\t\u003cp align=\"center\"\u003e\n\t\t\u003cimg alt=\"NPM DOWNLOADS\" src=\"https://img.shields.io/npm/dw/handyscript?color=5319e7\u0026style=flat-square\"\u003e\n\t\t\u003cimg alt=\"NPM LICENSE\" src=\"https://img.shields.io/npm/l/handyscript?color=k\u0026label=license\u0026style=flat-square\"\u003e\n\t\t\u003cimg alt=\"NPM VERSION\" src=\"https://img.shields.io/npm/v/handyscript?color=ff6905\u0026label=npm\u0026style=flat-square\"\u003e\n\t\u003c/p\u003e\n\t\u003cp align=\"center\"\u003e\n\t\t\u003ca href=\"https://github.com/handyscript/handyscript/actions/workflows/unite-test.yml\" target=\"_blank\"\u003e\n\t\t\t\u003cimg alt=\"JEST CI TEST\" src=\"https://github.com/handyscript/handyscript/actions/workflows/unite-test.yml/badge.svg?branch=main\"\u003e\n\t\t\u003c/a\u003e\n\t\t\u003ca href=\"https://socket.dev/npm/package/handyscript\" target=\"_blank\"\u003e\n\t\t\t\u003cimg alt=\"Socket Badge\" src=\"https://socket.dev/api/badge/npm/package/handyscript\" /\u003e\n\t\t\u003c/a\u003e\n\t\u003c/p\u003e\n\u003c/p\u003e\n\n## Installation\n\nYou can install **Handy Script** using npm:\n\n```shell\nnpm install handyscript\n```\n\nAlternatively, you can use the **CDN** script to include the `hs.min.js` in your HTML file\n\n```html\n\u003cscript src=\"https://unpkg.com/browse/handyscript@1.0.0/dist/hs.min.js\"\u003e\u003c/script\u003e\n```\n\nAlternatively, you can use the **CDN** script to include the `hs.min.js` in your HTML file\n\n```html\n\u003c!-- VIA: jsdelivr CDN --\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/handyscript@latest/dist/hs.min.js\"\u003e\u003c/script\u003e\n\u003c!-- VIA: unpkg CDN --\u003e\n\u003cscript src=\"https://unpkg.com/handyscript@latest/dist/hs.min.js\"\u003e\u003c/script\u003e\n```\n\nOtherwise, you can download the `hs.min.js` file from the [dist](./dist/hs.min.js) directory and include it in your HTML file, or [click here](https://cdn.jsdelivr.net/npm/handyscript@latest/dist/hs.min.js) to download it directly\n\n```html\n\u003cscript src=\"path/to/hs.min.js\"\u003e\u003c/script\u003e\n```\n\n## Usage\n\nOnce you have installed or included the **hs.min.js** file, you can start using the functions in your code.\n\n```javascript\n// Import the handyscript to extend the prebuilt js modules\nimport \"handyscript\";\n// explicitly use the HOperators, HashMap\nimport { HashMap } from \"handyscript\"\n\n// Array manipulation:\nconst arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];\nconsole.log(arr.chunk(3)); // [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10]]\nconsole.log(arr.shuffle()); // [3, 2, 5, 1, 4, 6, 7, 8, 10, 9]\nconsole.log(arr.shuffle().bubbleSort()); // [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n\n// The Math Module:\nconsole.log(Math.randomInt(1, 10)); // 7\n\n// HashMap\nconst obj = {\n    name: \"John\",\n    age: 20,\n    weight: 70,\n    height: 180,\n    isMarried: true,\n    isStudent: true,\n};\n\nconst map = new HashMap(obj);\n\nconsole.log(map.getKeysByValue(true)); // [\"isMarried\",\"isStudent\"]\n\n// Operators:\n const obj = { name:\"ahmed\", age: 20 };\n HOperators.objloop(obj, (key, val) =\u003e console.log(key, val))\n // name ahmed\n // age 20\n```\n\n## Functionalities\n\ncheck our detailed wiki documentation [here](https://github.com/handyscript/handyscript/wiki/)\n\n### [Array](https://github.com/handyscript/handyscript/blob/main/documentation/array.md)\n\nShuffles the elements of the array array and returns a new array.\n\n```javascript\nArray.prototype.shuffle()\n```\n\nThe `binarySearch` method searches an array for the specified item using the binary search algorithm. you can specify the sort algorithm to be used in sorting the array before searching\n\n```javascript\nArray.prototype.binarySearch(item, sortalgo)\n```\n\nSorting the array using specific sort algorithms like : `bubbleSort`\n\n```javascript\nArray.prototype.bubbleSort()\n```\n\n### [list of implemented sort algorithms](https://github.com/handyscript/handyscript/blob/main/documentation/array.md#sort-algorithms)\n\n- bubbleSort\n- insertionSort\n- selectionSort\n- mergeSort\n- quickSort\n- heapSort\n- countingSort # ⚠ Only works with arrays of numbers\n- shellSort\n- bucketSor\n- radixSort # ⚠ Only works with arrays of numbers\n\n\u003e There is more to discover [here](https://github.com/handyscript/handyscript/blob/main/documentation/array.md) ✨\n\n\u003c!-- \u003e It cover the most known/popular sort algorithms: --\u003e\n\n### Matrix\n\n```javascript\nimport { Matrix } from \"handyscript\";\n\n// Example usage\nconst matrix1 = new Matrix([\n  [1, 2, 3],\n  [4, 5, 6],\n]);\nconst matrix2 = new Matrix([\n  [1, 2],\n  [3, 4],\n  [5, 6],\n]);\n\nconst matrixAdd = Matrix.add(matrix1, matrix2);\nconsole.log(\"Matrix 1 + Matrix 2:\");\nmatrixAdd.log();\n\nconst matrixMulti = Matrix.multiply(matrix1, matrix2);\nconsole.log(\"Matrix 1 * Matrix 2:\");\nmatrixMulti.log();\n```\n\n\u003e There is more to discover ✨\n\n### Math\n\n```javascript\n// import the hole package:\nimport \"handyscript\";\n// or import the target lib/module\nimport \"handyscript/lib/math\";\n\nMath.clamp(value, min = 1, max)\nconsole.log(Math.randomInt(1, 10)); // 7\n```\n\nReturns a value that is clamped between min and max.\n\n\u003e There is more to discover ✨\n\n### String\n\n```javascript\n// import the hole package:\nimport \"handyscript\";\n// or import the target lib/module\nimport \"handyscript/lib/string\";\n\nString.prototype.toCapitalCase(); // \"Hello World\" // capitalizes the first letter of every word in a string.\nString.prototype.toCamelCase();// \"helloWorld\": // capitalizes the first letter of every word starting with the second word in a string and removes all the spaces.\nString.prototype.reverse(); // reverse a string and string\nString.prototype.indexesOf(target, startPosition? = 0); // Returns the positions of the all occurrence of a substring.\nString.prototype.escape(isForAttribute? = false): string; // escape a string from all white spaces and all control characters (characters with a code point \u003c U+0020).\n```\n\nExtends the builtin `String` module for more string manipulation\n\n\u003e There is more to discover ✨\n\n### Number\n\n```javascript\n// import the hole package:\nimport \"handyscript\";\n// or import the target lib/module\nimport \"handyscript/lib/number\";\n\nNumber.prototype.toHuman() // Returns a string representation of a number in human readable format. like 1K, 1M, 1B, 1T, etc.\nNumber.prototype.toReadable(separator? = \"-\") // Returns a string representation of a number readable format. like 10-000, 1-000-000, 1-000-000-000, etc.\n```\n\nExtends the prebuilt `Number` module for more number manipulation\n\n\u003e There is more to discover ✨\n\n### [JSON manipulation](https://github.com/handyscript/handyscript/blob/main/documentation/array.md)\n\n```javascript\nvar data = {\n    name: 'John Doe',\n    age: 30,\n    email: 'johndoe@example.com',\n    address: {\n        city: 'New York',\n        street: '123 Main St'\n    }\n};\n\nconst schema = {\n    name: { type: String, required: true },\n    age: { type: Number },\n    email: { type: String, required: true },\n    address: {\n        type: Object,\n        properties: {\n            city: { type: String },\n            street: { type: String }\n        }\n    }\n};\n\nJSON.validateSchema(data, schema); // True\n```\n\n\u003e There is more to discover [Here](https://github.com/handyscript/handyscript/blob/main/documentation/json.md) ✨\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhandyscript%2Fhandyscript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhandyscript%2Fhandyscript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhandyscript%2Fhandyscript/lists"}