{"id":13515727,"url":"https://github.com/auth0/id-generator","last_synced_at":"2025-04-05T17:07:35.170Z","repository":{"id":26903135,"uuid":"30364845","full_name":"auth0/id-generator","owner":"auth0","description":"Generates random ids with a prefix (a la Stripe)","archived":false,"fork":false,"pushed_at":"2023-02-16T12:34:48.000Z","size":57,"stargazers_count":69,"open_issues_count":0,"forks_count":17,"subscribers_count":110,"default_branch":"master","last_synced_at":"2025-03-29T16:07:32.605Z","etag":null,"topics":[],"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/auth0.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-02-05T16:13:40.000Z","updated_at":"2024-11-04T07:46:07.000Z","dependencies_parsed_at":"2024-06-18T14:08:19.126Z","dependency_job_id":"85f88106-4875-4e78-80ed-f71b2b45b41f","html_url":"https://github.com/auth0/id-generator","commit_stats":{"total_commits":32,"total_committers":9,"mean_commits":"3.5555555555555554","dds":0.5625,"last_synced_commit":"5e257b8031df4cb1a8e9f1fbf427a9701eefa1cb"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0%2Fid-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0%2Fid-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0%2Fid-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0%2Fid-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/auth0","download_url":"https://codeload.github.com/auth0/id-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247369952,"owners_count":20927928,"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":[],"created_at":"2024-08-01T05:01:15.308Z","updated_at":"2025-04-05T17:07:35.141Z","avatar_url":"https://github.com/auth0.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# id-generator\nGenerates random ids with a prefix (a la Stripe)\n\n## Installing\n```\nnpm i auth0-id-generator\n```\n\n## Using\nSimple case:\n```javascript\nvar IdGenerator = require('auth0-id-generator');\n\nvar generator = new IdGenerator();\nvar id = generator.new('cus');\n\nconsole.log(id); // cus_lO1DEQWBbQAACfHO\n```\n\nPredefined set of allowed prefixes (to avoid mistakes):\n```javascript\nvar IdGenerator = require('auth0-id-generator');\n\nvar generator = new IdGenerator(['cus', 'con']);\nvar id = generator.new('cus');\n\nconsole.log(id); // cus_lO1DEQWBbQAACfHO\n\ngenerator.new('cli'); // throws\n```\n\nTo get a uid (id with a given length and without prefix):\n```javascript\nvar IdGenerator = require('auth0-id-generator');\n\nvar generator = new IdGenerator(['cus', 'con']);\nvar id = generator.newUid(10);\n\nconsole.log(id); // lO1DEQWBbQ\n```\n\n## New API\nUpdated api allows more customizations. Uses a new method `.get()`:\n```javascript\nvar generator = new IdGenerator({len: 5, alphabet: 'abc123', prefix: 'foo', separator: ':'});\n\ngenerator.get();  // -\u003e foo:2a2b1\n```\n\n## Issue Reporting\n\nIf you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://auth0.com/whitehat) details the procedure for disclosing security issues.\n\n## Author\n\n[Auth0](auth0.com)\n\n## License\n\nThis project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauth0%2Fid-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fauth0%2Fid-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauth0%2Fid-generator/lists"}