{"id":48772578,"url":"https://github.com/lucasgdb/generate-strings","last_synced_at":"2026-04-13T11:07:12.355Z","repository":{"id":46646564,"uuid":"163826438","full_name":"lucasgdb/generate-strings","owner":"lucasgdb","description":"Generate random strings, strings with mask and strength passwords with password-strength tester","archived":false,"fork":false,"pushed_at":"2024-07-27T05:16:23.000Z","size":251,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-26T13:37:31.363Z","etag":null,"topics":["backend","biome","frontend","javascript","nodejs","password","password-generator","random","random-generation","string-mask","strings-manipulation","typescript","vitest"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/generate-strings","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/lucasgdb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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":"2019-01-02T10:23:50.000Z","updated_at":"2025-05-06T17:05:19.000Z","dependencies_parsed_at":"2025-08-15T06:58:42.948Z","dependency_job_id":"d3cf2595-1048-45fb-a7ba-b9ada6116a0d","html_url":"https://github.com/lucasgdb/generate-strings","commit_stats":null,"previous_names":["lucasnaja/generate-strings"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/lucasgdb/generate-strings","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasgdb%2Fgenerate-strings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasgdb%2Fgenerate-strings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasgdb%2Fgenerate-strings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasgdb%2Fgenerate-strings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucasgdb","download_url":"https://codeload.github.com/lucasgdb/generate-strings/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasgdb%2Fgenerate-strings/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31749830,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T09:16:15.125Z","status":"ssl_error","status_checked_at":"2026-04-13T09:16:05.023Z","response_time":93,"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":["backend","biome","frontend","javascript","nodejs","password","password-generator","random","random-generation","string-mask","strings-manipulation","typescript","vitest"],"created_at":"2026-04-13T11:07:12.294Z","updated_at":"2026-04-13T11:07:12.349Z","avatar_url":"https://github.com/lucasgdb.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# generate-strings\n\n# Generate random strings, strings with mask and strength passwords\n\n`generate-strings` is a string generator that build random strings, strings with mask and passwords with password-strength tester.\nIt is lightweight, extensible, has no dependencies, typescript support and can be used on the server with NodeJS or in-browser with JS.\n\n[![Build Status](https://travis-ci.com/lucasgdb/generate-strings.svg?branch=master)](https://travis-ci.com/lucasgdb/generate-strings)\n\n## Installing\n\n### Server-side (NodeJS)\n\nFrom the command line:\n\n```sh\nnpm install generate-strings --save\n```\n\nor\n\n```sh\nyarn add generate-strings\n```\n\nor\n\n```sh\npnpm add generate-strings\n```\n\n### In-browser\n\nWithin your document (each one for the desired function)\n\n```html\n\u003cscript src=\"generateRandomString.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"generateRandomStringWithMask.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"generateRandomPassword.min.js\"\u003e\u003c/script\u003e\n```\n\nor\n\n```html\n\u003cscript src=\"generateStrings.min.js\"\u003e\u003c/script\u003e\n```\n\n## Features\n\n1. Generate random strings:\n\n```ts\n',9nlg4^]'\n```\n\n2. Generate strings with mask:\n\n```ts\n'@#$%-@#$%-@#$%-@#$%' = 'Aa!0-Aa!0-Aa!0-Aa!0'\n```\n\n3. Generate passwords with password-strength tester:\n\n```ts\n{ password: '2dt4hKIPO*=He', strength: 'high' }\n```\n\n## Usage\n\nAfter you've included it into your project, using the module is straightforward:\n\n#### `generateRandomString(options)`\n\n#### `generateRandomStringWithMask(options)`\n\n#### `generateRandomPassword(options)`\n\n### Server-side\n\n```ts\n// require the module\nconst {\n   generateRandomString,\n   generateRandomStringWithMask,\n   generateRandomPassword,\n} = require('generate-strings');\n\nconsole.log(generateRandomString());\nconsole.log(generateRandomStringWithMask());\nconsole.log(generateRandomPassword());\n```\n\n### In-browser\n\n```ts\n// in the browser, including the script will make the function available.\nconsole.log(generateRandomString());\nconsole.log(generateRandomStringWithMask());\nconsole.log(generateRandomPassword());\n```\n\n## Configuring\n\nThe module may be configured as follows:\nOBS: The settings shown below are the defaults.\n\n```ts\nimport { generateRandomString } from 'generate-strings';\n\n// and then:\nconst randomString = generateRandomString();\n```\n\n### Available options for generateRandomString\n\n| Name                | Type    | Description                               | Default value                | Allowed values            |\n| ------------------- | ------- | ----------------------------------------- | ---------------------------- | ------------------------- |\n| stringLength        | Integer | Size of the string that will be generated | 8                            | 0-Number.MAX_SAFE_INTEGER |\n| upperCase           | Boolean | Determines whether it will be generated   | true                         | true, false               |\n| upperCaseCharacters | String  | UpperCase letters to be generated         | 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' | 'A-Z'                     |\n| lowerCase           | Boolean | Determines whether it will be generated   | true                         | true, false               |\n| lowerCaseCharacters | String  | LowerCase letters to be generated         | 'abcdefghijklmnopqrstuvwxyz' | 'a-z'                     |\n| special             | Boolean | Determines whether it will be generated   | false                        | true, false               |\n| specialCharacters   | String  | Special letters to be generated           | '!@#$%\u0026\\*()=[]{}'            | All special characters    |\n| number              | Boolean | Determines whether it will be generated   | true                         | true, false               |\n| numberCharacters    | String  | Numbers to be generated                   | '0123456789'                 | 0-9                       |\n\n### Available options for generateRandomStringWithMask\n\n| Name                | Type   | Description                                      | Default value                | Allowed values         |\n| ------------------- | ------ | ------------------------------------------------ | ---------------------------- | ---------------------- |\n| mask                | String | String mask that will be generated               | '@#$%-@#$%-@#$%-@#$%'        | \\*                     |\n| upperCaseCharacters | String | UpperCase letters to be generated                | 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' | 'A-Z'                  |\n| lowerCaseCharacters | String | LowerCase letters to be generated                | 'abcdefghijklmnopqrstuvwxyz' | 'a-z'                  |\n| specialCharacters   | String | Special letters to be generated                  | '!@#$%\u0026\\*()=[]{}'            | All special characters |\n| numberCharacters    | String | Numbers to be generated                          | '0123456789'                 | 0-9                    |\n| upperCaseMask       | String | Letter that will be replaced to a upperCase char | '@'                          | '\\*'                   |\n| lowerCaseMask       | String | Letter that will be replaced to a lowerCase char | '#'                          | '\\*'                   |\n| specialMask         | String | Letter that will be replaced to a special char   | '$'                          | '\\*'                   |\n| numberMask          | String | Letter that will be replaced to a number         | '%'                          | '\\*'                   |\n\n### Available options for generateRandomPassword\n\n| Name                | Type    | Description                                     | Default value                | Allowed values                                          |\n| ------------------- | ------- | ----------------------------------------------- | ---------------------------- | ------------------------------------------------------- |\n| passwordLength      | Integer | Size of the strings that will be generated      | 8                            | 0-Number.MAX_SAFE_INTEGER                               |\n| showStrength        | Boolean | Shows the password strength                     | false                        | true, false                                             |\n| excludeEqualChars   | Boolean | Excludes characters that are consecutive equals | false                        | true, false                                             |\n| firstCharType       | String  | Determines the type of first character          | 'random'                     | 'random', 'upperCase', 'lowerCase', 'special', 'number' |\n| upperCase           | Boolean | Determines whether it will be generated         | true                         | true, false                                             |\n| upperCaseCharacters | String  | UpperCase letters to be generated               | 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' | 'A-Z'                                                   |\n| lowerCase           | Boolean | Determines whether it will be generated         | true                         | true, false                                             |\n| lowerCaseCharacters | String  | LowerCase letters to be generated               | 'abcdefghijklmnopqrstuvwxyz' | 'a-z'                                                   |\n| special             | Boolean | Determines whether it will be generated         | false                        | true, false                                             |\n| specialCharacters   | String  | Special letters to be generated                 | '!@#$%\u0026\\*()=[]{}'            | All special characters                                  |\n| number              | Boolean | Determines whether it will be generated         | true                         | true, false                                             |\n| numberCharacters    | String  | Numbers to be generated                         | '0123456789'                 | 0-9                                                     |\n\n## Examples\n\n```ts\nimport {\n   generateRandomString,\n   generateRandomStringProps,\n} from 'generate-strings';\n\nconst settings: generateRandomStringProps = {\n   stringLength: 15,\n   special: true,\n};\n\nconst randomStringWithMask = generateRandomString(settings); // will return a string like: bov$Ia@}Rr8gzU*\n```\n\n```ts\nimport {\n   generateRandomStringWithMask,\n   generateRandomStringWithMaskProps,\n} from 'generate-strings';\n\nconst settings: generateRandomStringWithMaskProps = {\n   upperCaseMask: '\u0026',\n   mask: '####_####%@hotmail.com',\n};\n\nconst randomStringWithMask = generateRandomStringWithMask(settings); // will return a string like: ekts_raqm1@hotmail.com\n```\n\n```ts\nimport {\n   generateRandomPassword,\n   generateRandomPasswordProps,\n} from 'generate-strings';\n\nconst settings: generateRandomPasswordProps = {\n   passwordLength: 12,\n   special: true,\n   showStrength: true,\n   excludeEqualChars: true,\n};\n\nconst randomPassword = generateRandomPassword(settings); // will return a object like: { password: 'T2$he{Yk6pvf', strength: 'high' }\n```\n\n## Testing\n\nTo test the application, run `yarn test`. You may first need to run `yarn` to install the required development dependencies. (These dependencies are **not** required in a production environment, and facilitate only unit testing.)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucasgdb%2Fgenerate-strings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucasgdb%2Fgenerate-strings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucasgdb%2Fgenerate-strings/lists"}