{"id":21003282,"url":"https://github.com/koding/node-kd","last_synced_at":"2026-04-15T06:40:08.846Z","repository":{"id":143882219,"uuid":"84436061","full_name":"koding/node-kd","owner":"koding","description":null,"archived":false,"fork":false,"pushed_at":"2017-05-30T17:00:58.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":12,"default_branch":"master","last_synced_at":"2026-01-01T00:26:55.516Z","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/koding.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":"2017-03-09T11:47:01.000Z","updated_at":"2017-03-09T12:07:49.000Z","dependencies_parsed_at":"2023-07-21T09:00:36.660Z","dependency_job_id":null,"html_url":"https://github.com/koding/node-kd","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/koding/node-kd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koding%2Fnode-kd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koding%2Fnode-kd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koding%2Fnode-kd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koding%2Fnode-kd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koding","download_url":"https://codeload.github.com/koding/node-kd/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koding%2Fnode-kd/sbom","scorecard":{"id":565671,"data":{"date":"2025-08-18","repo":{"name":"github.com/koding/node-kd","commit":"dd54b2f67ed58d41d278ba068607720c9376c6fc"},"scorecard":{"version":"v5.2.1-41-g40576783","commit":"40576783fda6698350fcbbeaea760ff827433034"},"score":3.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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#maintained"}},{"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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#token-permissions"}},{"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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":1,"reason":"Found 2/17 approved changesets -- score normalized to 1","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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#code-review"}},{"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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#signed-releases"}},{"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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#vulnerabilities"}},{"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/40576783fda6698350fcbbeaea760ff827433034/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 9 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T14:55:16.462Z","repository_id":143882219,"created_at":"2025-08-20T14:55:16.462Z","updated_at":"2025-08-20T14:55:16.462Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31830157,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"online","status_checked_at":"2026-04-15T02:00:06.175Z","response_time":63,"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":[],"created_at":"2024-11-19T08:24:36.862Z","updated_at":"2026-04-15T06:40:08.819Z","avatar_url":"https://github.com/koding.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"node-kd\n=======\n\nA thin node.js wrapper around `kd` cli tool.\n\n### What?\n\nIt's designed to be an extension layer on top of `kd` so that one could extend the functionality of each commands.\n\n```bash\nnpm install --global kd\n\n# it exposes a `kdx` binary.\nkdx auth login\n# =\u003e same as running kd auth login\n```\n\n\n## Extending `kd`\n\n1) To match `kdx your command` create a file under `src/commands/your/command.js`\n\n```js\n// commands/example/init.js\n\n// this command will run when we type `kdx example init`\n\nexport default {\n  run(args, { run }) {\n    console.log('running init command')\n\n    return askTeamAndBaseUrl().then(({baseurl, team}) =\u003e {\n      return run(\n        ['auth', 'login', '--baseurl', baseurl, '--team', team]\n      )\n    })\n    .then(() =\u003e {\n      return run(\n        ['template', 'create']\n      )\n    })\n  }\n}\n\n```\n\na command is a simple object containing the following keys:\n- `before(initialArgs: Array\u003cString\u003e, { run: Function }) =\u003e args: Promise\u003cArray\u003cString\u003e\u003e`\n\n  Accepts initial args, and it's expected to return an array to be passed to the `run` function as `args`. If return value is a promise, the resolved value will be passed to `run` function.\n\n    - **tl;dr:** Return a promise if you need to do async stuff.\n\n- `run(args: \u003cArray\u003cString\u003e\u003e, { run: Function }) =\u003e Promise`\n\n  A function accepts the result of `before` function. If `before` function doesn't exist, it will be passed the original args.\n\n- `after(result: any) =\u003e Promise`\n\n  A function accepts the result of `run` function.\n\n**IMPORTANT**: You **HAVE TO** return either an array or a Promise which will return an array from `before` function. This result will either be passed to `run` function of the command if defined, or to the main `kd` command you are wrapping.\n\n2) Try your command:\n\n```bash\ncd /your/node-kd/path\nnpm run run-cli -- example init\n# =\u003e running init command\n```\n\nor with `npm link`\n\n```bash\ncd /your/node-kd/path\nnpm link\n\nkdx example init\n# =\u003e running init command\n```\n\n3) Add functionality to an existing command:\n\n```js\n// file =\u003e src/commands/template/create.js\n// cmd =\u003e kdx template create\n\nexport default {\n\n  before(args) {\n\n    console.log(' before template create ')\n\n    return args\n  }\n\n  after(result) {\n\n    console.log(' after template create ')\n\n    return args\n  }\n\n}\n```\n\nrun in terminal:\n\n```bash\nkdx template create\n# =\u003e before template create\n# =\u003e ...\n# =\u003e ...\n# =\u003e ... (running kd template create)\n# =\u003e ...\n# =\u003e ...\n# =\u003e after template create\n```\n\nSince we didn't create a `run` function in `src/commands/template/create.js` it didn't override the main functionality of `kd template create`; it just ran `before(args)` before and `after(result)` after it.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoding%2Fnode-kd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoding%2Fnode-kd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoding%2Fnode-kd/lists"}