{"id":17032919,"url":"https://github.com/up9cloud/node-cdkey","last_synced_at":"2026-03-15T07:09:26.832Z","repository":{"id":3857551,"uuid":"51136577","full_name":"up9cloud/node-cdkey","owner":"up9cloud","description":"generate random string by template.","archived":false,"fork":false,"pushed_at":"2023-03-01T02:41:06.000Z","size":1671,"stargazers_count":9,"open_issues_count":8,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-17T11:53:12.948Z","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/up9cloud.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":"2016-02-05T09:05:58.000Z","updated_at":"2025-05-22T05:43:08.000Z","dependencies_parsed_at":"2023-07-06T09:01:49.397Z","dependency_job_id":null,"html_url":"https://github.com/up9cloud/node-cdkey","commit_stats":{"total_commits":28,"total_committers":4,"mean_commits":7.0,"dds":0.6071428571428572,"last_synced_commit":"431e04164b8fabcb45943c1d7535b11c4e8c40e0"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/up9cloud/node-cdkey","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/up9cloud%2Fnode-cdkey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/up9cloud%2Fnode-cdkey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/up9cloud%2Fnode-cdkey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/up9cloud%2Fnode-cdkey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/up9cloud","download_url":"https://codeload.github.com/up9cloud/node-cdkey/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/up9cloud%2Fnode-cdkey/sbom","scorecard":{"id":911244,"data":{"date":"2025-08-11","repo":{"name":"github.com/up9cloud/node-cdkey","commit":"431e04164b8fabcb45943c1d7535b11c4e8c40e0"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2,"checks":[{"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":"Code-Review","score":-1,"reason":"Found no human activity in the last 17 changesets","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":"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":"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":"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":"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":"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":"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":"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":"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":"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"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"52 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-2j2x-2gpw-g8fm","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-h9rv-jmmf-4pgx","Warn: Project is vulnerable to: GHSA-hxcc-f52p-wc94","Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp","Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T19:16:58.508Z","repository_id":3857551,"created_at":"2025-08-24T19:16:58.508Z","updated_at":"2025-08-24T19:16:58.508Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30537196,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-15T06:53:40.532Z","status":"ssl_error","status_checked_at":"2026-03-15T06:51:47.131Z","response_time":61,"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":[],"created_at":"2024-10-14T08:30:57.496Z","updated_at":"2026-03-15T07:09:26.800Z","avatar_url":"https://github.com/up9cloud.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-cdkey\n\n[![Build Status](https://travis-ci.org/up9cloud/node-cdkey.svg?branch=master)](https://travis-ci.org/up9cloud/node-cdkey)\n[![Coverage Status](https://coveralls.io/repos/github/up9cloud/node-cdkey/badge.svg?branch=master)](https://coveralls.io/github/up9cloud/node-cdkey?branch=master)\n\nGenerate random string by template.\n\n## Installation\n\n```sh\nnpm i cdkey\n```\n\n## Basic Usage\n\n\u003e Browser\n\n```html\n\u003cscript src=\"https://unpkg.com/cdkey/dist/cdkey.min.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  console.log(cdkey.default()) // eC8q-8ERg-fTZa-Vh2o\n\u003c/script\u003e\n```\n\n\u003e Node.js\n\n```js\nimport cdkey from 'cdkey' // esm\n\nconst cdkey = require('cdkey/lib').default // cjs\n\nconsole.log(cdkey()) // eC8q-8ERg-fTZa-Vh2o\n```\n\n## Advenced Usage\n\n### Simple amount\n\nGenerate string by default template (diablo style).\n\n```js\ncdkey([Number amount])\n```\n\n```js\ncdkey() // eC8q-8ERg-fTZa-Vh2o\ncdkey(2) // [ 'kcsi-V5xR-1xv8-zq7q', 'cumh-jYVn-5vL9-mwLM' ]\n```\n\n### Template\n\nGenerate string by custom template.\n\n```js\ncdkey(String template, [Number amount], [Object syntax])\n```\n\n| syntax | chars for random      | exclude non-readable chars |\n| ------ | --------------------- | -------------------------- |\n| `0`    | [0-9]                 | [01]                       |\n| `A`    | [A-Z]                 | [OI]                       |\n| `a`    | [a-z]                 | [l]                        |\n| `X`    | [0-9] + [A-Z]         | [01OI]                     |\n| `x`    | [0-9] + [a-z]         | [01l]                      |\n| `?`    | [0-9] + [A-Z] + [a-z] | [01OIl]                    |\n\n```js\ncdkey('XXXX') // 7F3K\ncdkey('????', 2) // [ 'cUwc', 'n9zu' ]\n\ncdkey('AAAA', { A: 'AB' }) // ABBA\ncdkey('cccc', 2, { c: 'ABC' }) // [ 'BCAA', 'ACAB' ]\n```\n\n### Options\n\nGenerate string by custom or builtin options.\n\n```js\ncdkey(Object options, [Number amount, [String template | Number length]])\n```\n\n- The 2ed argument would override options.amount\n- The 3rd argument would override options.template or options.length, depand on style.\n\n| attribute        | type   | default |\n| ---------------- | ------ | ------- |\n| options.char     | string |         |\n| options.length   | number |         |\n| options.template | string |         |\n| options.syntax   | object |         |\n| options.amount   | number | 1       |\n\n\u003e char + length (custom)\n\n```js\ncdkey({\n  char: 'abc',\n  length: 4\n})\n// acab\n\ncdkey({\n  char: 'abc',\n  length: 4,\n  amount: 2\n}, 1, 3)\n// aca\n```\n\n\u003e template + syntax (custom)\n\n```js\ncdkey({\n  template: 'aaaa',\n  syntax: {\n    a: '012'\n  },\n  amount: 2\n})\n// [ \"1220\", \"2001\" ]\n\ncdkey({\n  template: '0000',\n  syntax: {\n    a: '012'\n  },\n  amount: 5\n}, 2, 'aaaa')\n// [ \"1220\", \"2001\" ]\n```\n\n\u003e char + length (builtin options)\n\n| key                 | char          | length |\n| ------------------- | ------------- | ------ |\n| `ALPHANUMERIC`      | [0-9 a-z A-Z] | 32     |\n| `ALPHABETIC`        | [a-z A-Z]     | 32     |\n| `NUMBER`, `NUMERIC` | [0-9]         | 32     |\n| `UPPER`             | [A-Z]         | 32     |\n| `LOWER`             | [a-z]         | 32     |\n| `HEX`               | [0-9 A-F]     | 32     |\n\n```js\nimport { cdkey, NUMBER } from 'cdkey'\n\ncdkey(NUMBER) // 22030189956236488846744098007707\ncdkey(NUMBER, 2, 8) // [ '05250373', '42852368' ]\n```\n\n\u003e template + syntax (builtin options)\n\n| key       | template              |\n| --------- | --------------------- |\n| `DEFAULT` | '????-????-????-????' |\n| `DIABLO`  | 'XXXX-XXXX-XXXX-XXXX' |\n\n```js\nimport { cdkey, DIABLO } from 'cdkey'\n\ncdkey(DIABLO, 2) // [ '2F2L-HJTG-P4L6-QBTZ', 'F1XM-K9JZ-ED9L-EPL9' ]\n```\n\n### Fluent (chain methods)\n\nGenerate string by custom options and chain methods.\n\n```js\nimport { create } from 'cdkey'\n\ncreate()\n  .char(String chars)\n  .length(Number length)\n  .template(String template)\n  .syntax(Object syntax)\n  .amount(Number amount)\n  .gen()\n```\n\n```js\ncreate()\n  .char('012')\n  .length(8)\n  .gen()\n// 01201002\n\ncreate()\n  .template('AAAA')\n  .syntax({ A: 'ABC' })\n  .amount(2)\n  .gen()\n// [ 'BCAA', 'ACAB' ]\n```\n\n### Helper methods\n\n```js\nimport { syntax } from 'cdkey'\nsyntax() // To get default syntax object.\n// {\n//   '0': '23456789',\n//   'A': 'ABCDEFGHJKLMNPQRSTUVWXYZ',\n//   'a': 'abcdefghijkmnopqrstuvwxyz',\n//   'X': '23456789ABCDEFGHJKLMNPQRSTUVWXYZ',\n//   'x': '23456789abcdefghijkmnopqrstuvwxyz',\n//   '?': '23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'\n// }\n```\n\n## TODO\n\n- escape string in template.\n- command line support.\n- ~~browser support.~~\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fup9cloud%2Fnode-cdkey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fup9cloud%2Fnode-cdkey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fup9cloud%2Fnode-cdkey/lists"}