{"id":24789138,"url":"https://github.com/cschen1205/js-sorting-algorithms","last_synced_at":"2025-10-12T13:30:37.592Z","repository":{"id":57283646,"uuid":"92123644","full_name":"cschen1205/js-sorting-algorithms","owner":"cschen1205","description":"Package provides javascript of array sorting algorithms","archived":false,"fork":false,"pushed_at":"2017-05-31T02:05:04.000Z","size":32,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-07T05:33:00.723Z","etag":null,"topics":["3-ways-quick-sort","heap-sort","insertion-sort","merge-sort","quick-sort","selection-sort","shell-sort"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cschen1205.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}},"created_at":"2017-05-23T03:12:45.000Z","updated_at":"2025-08-01T04:30:24.000Z","dependencies_parsed_at":"2022-09-04T18:53:29.020Z","dependency_job_id":null,"html_url":"https://github.com/cschen1205/js-sorting-algorithms","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cschen1205/js-sorting-algorithms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cschen1205%2Fjs-sorting-algorithms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cschen1205%2Fjs-sorting-algorithms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cschen1205%2Fjs-sorting-algorithms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cschen1205%2Fjs-sorting-algorithms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cschen1205","download_url":"https://codeload.github.com/cschen1205/js-sorting-algorithms/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cschen1205%2Fjs-sorting-algorithms/sbom","scorecard":{"id":310718,"data":{"date":"2025-08-11","repo":{"name":"github.com/cschen1205/js-sorting-algorithms","commit":"4947b93125fd82941e099b49d179df1e4b52cb9a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/23 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-17T23:08:19.604Z","repository_id":57283646,"created_at":"2025-08-17T23:08:19.604Z","updated_at":"2025-08-17T23:08:19.604Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279011065,"owners_count":26084865,"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","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"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":["3-ways-quick-sort","heap-sort","insertion-sort","merge-sort","quick-sort","selection-sort","shell-sort"],"created_at":"2025-01-29T17:16:12.714Z","updated_at":"2025-10-12T13:30:37.298Z","avatar_url":"https://github.com/cschen1205.png","language":"JavaScript","readme":"# js-sorting-algorithms\nPackage provides the javascript implementation of sorting algorithms for array\n\n[![Build Status](https://travis-ci.org/cschen1205/js-sorting-algorithms.svg?branch=master)](https://travis-ci.org/cschen1205/js-sorting-algorithms) [![Coverage Status](https://coveralls.io/repos/github/cschen1205/js-sorting-algorithms/badge.svg?branch=master)](https://coveralls.io/github/cschen1205/js-sorting-algorithms?branch=master) \n\n# Features\n\nIn terms of usage, the user has the following benefit of using the sorting algorithms:\n\n* Customizable comparer function for the sorting function\n* Allow user to sort a sublist of an array starting and ending at the user-defined indices\n\nIn terms of supported algorithms for sorting:\n\n* Selection Sort\n* Insertion Sort\n* Merge Sort\n* Quick Sort\n* 3-Ways Quick Sort\n* Heap Sort\n* Shell Sort\n\n# Install\n\nRun the following npm command to install\n\n```bash\nnpm install js-sorting-algorithms\n```\n\n# Usage\n\nTo sort an array \"a\" using any of the sorting algorithms:\n\n```javascript\njss.insertionSort(a);\njss.selectionSort(a);\njss.shellSort(a);\njss.mergeSort(a);\njss.quickSort(a);\njss.threeWaysQuickSort(a);\njss.heapSort(a);\n```\n\nAdditionally user can specify the range in \"a\" to do the sorting as well as customized comparer:\n\n```javascript\nvar comparer = function(a1, a2){\n    return a1 - a2;\n};\n\njss.insertionSort(a, lo, hi, comparer);\n```\n\n\nSample code is available at [playground](https://runkit.com/cschen1205/js-sorting-algorithms-playground)\n\n### Using with nodejs\n\n```javascript\njssort = require('js-sorting-algorithms');\n\n//====================Simple====================//\n\nvar a = [3, 4, 5, 1, 2, 4, 6, 8, 9, 3, 4, 67, 34, 53, 44, 2];\njssort.insertionSort(a);\nconsole.log(a);\n\n//====================Sort with custom comparer function====================//\nvar a = [[3, 2.3], [4, 3.1], [5, 1.1], [1, 4.2], [2, 4.2], [4, 5.3], [6, 7.4], [8, 5.1], [9, 1.9], [3, 1.2], [4, 3.4], [67, 6.7], [34, 3], [53, 5], [44, 4.2], [2, 0]];\njssort.insertionSort(a, undefined, undefined, function(a1, a2){\n         return a1[1] - a2[1];\n});\nconsole.log(a);\n\n\n//====================Sort sub-arrray a[3:10] ====================//\nvar a = [3, 4, 5, 1, 2, 4, 6, 8, 9, 3, 4, 67, 34, 53, 44, 2];\njssort.insertionSort(a, 3, 10);\nconsole.log(a);\n\n\n\n```\n\n### Using with HTML page\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcschen1205%2Fjs-sorting-algorithms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcschen1205%2Fjs-sorting-algorithms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcschen1205%2Fjs-sorting-algorithms/lists"}