{"id":17354064,"url":"https://github.com/forinda/string-shuffle","last_synced_at":"2025-03-27T13:24:21.373Z","repository":{"id":38336263,"uuid":"499037355","full_name":"forinda/string-shuffle","owner":"forinda","description":"A JS module for shuffling strings and other helper methods like alphabet generation","archived":false,"fork":false,"pushed_at":"2023-01-13T16:32:30.000Z","size":177,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-01T21:46:58.925Z","etag":null,"topics":["alphabet","automation","lowercase","random","shuffle","vowels"],"latest_commit_sha":null,"homepage":"https://felix-orinda.github.io/string-shuffle/","language":"TypeScript","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/forinda.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":"2022-06-02T07:35:16.000Z","updated_at":"2023-02-20T22:39:24.000Z","dependencies_parsed_at":"2023-02-09T16:16:30.204Z","dependency_job_id":null,"html_url":"https://github.com/forinda/string-shuffle","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forinda%2Fstring-shuffle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forinda%2Fstring-shuffle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forinda%2Fstring-shuffle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forinda%2Fstring-shuffle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/forinda","download_url":"https://codeload.github.com/forinda/string-shuffle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245851327,"owners_count":20682834,"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":["alphabet","automation","lowercase","random","shuffle","vowels"],"created_at":"2024-10-15T17:18:53.461Z","updated_at":"2025-03-27T13:24:21.351Z","avatar_url":"https://github.com/forinda.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# String-shuffle\n\nA JS module for shuffling strings and other helper methods like alphabet generation\n\nA quick reference\n```ts\nimport * as shuffle from \"string-shuffle\";\n\nconsole.log(shuffle.shuffleString(\"Hello World\")); // dlH ooWler\n\nconsole.log(shuffle.shuffleString(\"Hello World\")); // rdlloH loWe\n\nconsole.log(shuffle.shuffleString(\"Quick rown fox jumps over lazy dog\")); // jvyilco owfxud nz  apuo rs rkeoQgm\nconsole.log(shuffle.shuffleString(\"Quick rown fox jumps over lazy dog\")); // jcf ro Qowkna goomvyxd puz er iusl\n\nconsole.log(shuffle.shuffleString(\"test123@shuffle.com\")); // ecot@shmt.efs2l3fu1\nconsole.log(shuffle.shuffleString(\"test123@shuffle.com\")); // hsms3e@.2t1lcfotufe\n\n```\nOther ways\n```ts\nimport { shuffleString } from \"string-shuffle\";\n\nconsole.log(shuffleString(\"Hello World\")); // lHlWero odl\nconsole.log(shuffleString(\"someRandomString\")); // irdosaRenSomntgm\nconsole.log(shuffleString(\"1234IsAnAmazingString@#$%^\u0026*()\")); // m41n(I\u0026aA@Sn^i3%)sgzgi#2*rn$At\n\nconsole.log(shuffleString(\"Hello World\")); // lH oWlolrde\nconsole.log(shuffleString(\"someRandomString\")); // nitRsgoaSmrdeomn\nconsole.log(shuffleString(\"1234IsAnAmazingString@#$%^\u0026*()\")); // t3nAnr@4Ii\u0026n12gAgsa%m*(i$Sz)#^\n\n```\nOther included modules include\n\n|Module|Functionality|\n|---|---|\n|`alphabets`| A method that contains all the `lowercase`,`uppercase`, `numbers` and `symbols` array|\n| `lowerCaseLetters`|List of all the Capital letters of the alphabet|\n| `capitalize`| A method to make the  `first letter` of a word or statement to uppercase and retain others if they are not lowercase|\n| `upperCaseLetters`|List of all the lowercase letters of the alphabet|\n| `numbers`|List of numbers from `0-9`|\n| `symbols`|Sample list of symbols|\n| `generateRandomString`| A method that generates a random strigg based on the number you pass as an argument|\n| `generateShuffledPassword`|Generates random paswords with combination of `caps`,`lowercase`,`uppercase`,`numbers` and `symbols` then shuffles the password to achieve randomness|\n| `generateUnshuffledPassword`|Generates the normal concatenated cobinaton of characters|\n| `shuffleString`|A method that shuffles the string you pass to it as an argument|\n\n## `alphabets` module\n```ts\nimport { alphabets } from \"string-shuffle\";\n\nconst { alphabet, lowerCaseLetters, numbers, symbols, upperCaseLetters } =\n  alphabets();\n\nconsole.log(alphabet.join(\"\")); //ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"#$%\u0026'()*+,-./\n\nconsole.log(lowerCaseLetters.join(\"\")); //abcdefghijklmnopqrstuvwxyz\n\nconsole.log(numbers.join(\"\")); //0123456789\n```\nStill the modules can be imported from the main package\n```diff\n- import { alphabets } from \"string-shuffle\";\n+ import {lowerCaseLetters,numbers,symbols,upperCaseLetters} from \"string-shuffle\";\n\n- const { alphabet, lowerCaseLetters, numbers, symbols, upperCaseLetters } = alphabets();\n\n- console.log(alphabet.join(\"\")); //ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"#$%\u0026'()*+,-./\n\nconsole.log(lowerCaseLetters.join(\"\")); //abcdefghijklmnopqrstuvwxyz\n\nconsole.log(numbers.join(\"\")); //0123456789\n```\n## `capitalize` module\n```ts\nimport { capitalize } from \"string-shuffle\";\n\nconsole.log(capitalize(\"hello world\")); // Hello world\n\nconsole.log(capitalize(\"tetris\")); // Tetris\n\nconsole.log(capitalize(\"my name is a test name\")); // My name is a test name\n\nconsole.log(capitalize(\"A\")); // A\n\nconsole.log(capitalize(\"ABC\")); // ABC\n\nconsole.log(capitalize(\"123\")); // 123\n```\n## `generateRandomString` module\nBy default it shuffles the string\n```ts\nimport { generateRandomString } from \"string-shuffle\";\n\nconsole.log(generateRandomString(5)); // ye!o\n\nconsole.log(generateRandomString(10)); // #m)tX\u0026Kza8\n\nconsole.log(generateRandomString(15)); // eTQa1ts$pA8*nwI\n\nconsole.log(generateRandomString(20)); // Fryo*JEn1i\u00262Dp7rgqFK\n\nconsole.log(generateRandomString(30)); // 8+Zs4,XaodpQxHMp,xUw8if0dy)TF+\n```\n### `generateUnshuffledPassword` module\nDisclaimer: Use this at your own risk. It's here for mock apps or just simple programs so be careful on the usage\n```ts\nimport { generateUnshuffledPassword } from \"string-shuffle\";\n\nconsole.log(generateUnshuffledPassword({})); // ey99\nconsole.log(generateUnshuffledPassword({ lower: 1, upper: 2, num: 3, symb: 4 })); // pRI.##*369\n\nconsole.log(generateUnshuffledPassword({ lower: 2, upper: 2, num: 2, symb: 2 })); // jmKE\"+89\n\nconsole.log(generateUnshuffledPassword({ lower: 4, upper: 4, num: 4, symb: 4 })); // gilwLEJW#/,%6959\n\nconsole.log(generateUnshuffledPassword({ lower: 5, upper: 5, num: 5, symb: 5 })); // rkujyDFOUS%,.)'71677\n```\n\n## `generateShuffledPassword` module\n```ts\nimport { generateShuffledPassword, shuffleString } from \"string-shuffle\";\n\nconsole.log(generateShuffledPassword(shuffleString)({})); // 3n3r\n\nconsole.log(generateShuffledPassword(shuffleString)({ lower: 1, upper: 2, num: 3, symb: 4 })); // o9/B3*M\u00263*\n\nconsole.log(generateShuffledPassword(shuffleString)({ lower: 2, upper: 2, num: 2, symb: 2 })); // O5g!8A/c\n\nconsole.log(generateShuffledPassword(shuffleString)({ lower: 4, upper: 4, num: 4, symb: 4 })); // 3p!rP.YI*90z*n7Z\n\nconsole.log(generateShuffledPassword(shuffleString)({ lower: 5, upper: 5, num: 5, symb: 5 })); // zS7\u00266*oKk7Wx)Nl'N18.\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforinda%2Fstring-shuffle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fforinda%2Fstring-shuffle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforinda%2Fstring-shuffle/lists"}