{"id":24253472,"url":"https://github.com/kukhariev/diskinfo","last_synced_at":"2025-09-23T17:31:38.229Z","repository":{"id":32458864,"uuid":"133607055","full_name":"kukhariev/diskinfo","owner":"kukhariev","description":"Disk usage info on both *nix (via df) and Windows (via WMIC) systems","archived":false,"fork":false,"pushed_at":"2022-09-28T05:24:54.000Z","size":111,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-16T16:01:54.900Z","etag":null,"topics":["df","disk-usage","typescript","wmic"],"latest_commit_sha":null,"homepage":"","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/kukhariev.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":"2018-05-16T03:44:38.000Z","updated_at":"2025-08-27T12:16:46.000Z","dependencies_parsed_at":"2022-08-09T08:46:54.624Z","dependency_job_id":null,"html_url":"https://github.com/kukhariev/diskinfo","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/kukhariev/diskinfo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kukhariev%2Fdiskinfo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kukhariev%2Fdiskinfo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kukhariev%2Fdiskinfo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kukhariev%2Fdiskinfo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kukhariev","download_url":"https://codeload.github.com/kukhariev/diskinfo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kukhariev%2Fdiskinfo/sbom","scorecard":{"id":573140,"data":{"date":"2025-08-11","repo":{"name":"github.com/kukhariev/diskinfo","commit":"b8cfc51f9122ca304c37a93d9da9a1fedfc7df52"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/nodejs.yml:1","Info: no jobLevel write permissions found"],"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":"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":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/kukhariev/diskinfo/nodejs.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/kukhariev/diskinfo/nodejs.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/nodejs.yml:21","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"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":"Code-Review","score":0,"reason":"Found 0/3 approved changesets -- score normalized to 0","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":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"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":"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":"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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 28 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"}}]},"last_synced_at":"2025-08-20T16:53:33.412Z","repository_id":32458864,"created_at":"2025-08-20T16:53:33.412Z","updated_at":"2025-08-20T16:53:33.412Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275498569,"owners_count":25475763,"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","status":"online","status_checked_at":"2025-09-16T02:00:10.229Z","response_time":65,"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":["df","disk-usage","typescript","wmic"],"created_at":"2025-01-15T03:50:48.633Z","updated_at":"2025-09-23T17:31:37.491Z","avatar_url":"https://github.com/kukhariev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# diskinfo\n\n\u003e Disk usage info on both \\*nix (via `df`) and Windows (via `WMIC`) systems\n\n[![npm z][npm-image]][npm-url]\n[![Build status][test-image]][test-url]\n\n## Install\n\n```sh\nnpm install @dropb/diskinfo\n```\n\n## Usage examples\n\n```js\n// JS example (Windows)\n\nconst { diskinfo } = require('@dropb/diskinfo');\n\ndiskinfo()\n  .then(result =\u003e console.log(result))\n  .catch(err =\u003e console.error(err.message));\n/* OUTPUT:\n[{\n    fstype: '3',\n    size: 185429127168,\n    used: 51971362816,\n    avail: 133457764352,\n    pcent: '29%',\n    target: 'C:'\n  },\n  {\n    fstype: '2',\n    size: 16046358528,\n    used: 4434288640,\n    avail: 11612069888,\n    pcent: '28%',\n    target: 'F:'\n  },\n  {\n    fstype: '4',\n    size: 107569381376,\n    used: 106081509376,\n    avail: 1487872000,\n    pcent: '99%',\n    target: 'V:'\n  }]\n*/\n```\n\n```ts\n// Typescript example (Ubuntu)\n\nimport { diskinfo, DiskInfo } from '@dropb/diskinfo';\n\nasync function run() {\n  const result: DiskInfo = await diskinfo('./');\n  console.log(result);\n}\nrun();\n/* OUTPUT:\n{ fstype: '/dev/sda1',\n  size: 47242534912,\n  used: 21033943040,\n  avail: 23785177088,\n  pcent: '47%',\n  target: '/' }\n*/\n```\n\n## API\n\n```ts\n/**\n * @param file - get info of the filesystem containing the specified file or directory\n * @returns promise for an object with the info for the specified file or directory\n */\nfunction diskinfo(file: string): Promise\u003cDiskInfo\u003e;\n\n/**\n * @returns promise for an array with the info for all mounted filesystem\n */\nfunction diskinfo(): Promise\u003cDiskInfo[]\u003e;\n\n/**\n * Info of the filesystem\n */\ninterface DiskInfo {\n  /**\n   * POSIX - File system type\n   *\n   * Win32 - Win32_LogicalDisk DriveType(as `String`!):\n   * - \"0\": Unknown\n   * - \"1\": No Root Directory\n   * - \"2\": Removable Disk\n   * - \"3\": Local Disk\n   * - \"4\": Network Drive\n   * - \"5\": Compact Disc\n   * - \"6\": RAM Disk\n   */\n  fstype: string;\n  /**\n   * Total size in bytes\n   */\n  size: number;\n  /**\n   * Used size in bytes\n   */\n  used: number;\n  /**\n   * Available size in bytes\n   */\n  avail: number;\n  /**\n   * Percentage of used divided by size\n   */\n  pcent: string;\n  /**\n   * Mount point\n   */\n  target: string;\n}\n```\n\n## References\n\n- [df](https://www.gnu.org/software/coreutils/manual/html_node/df-invocation.html)\n- [Win32_LogicalDisk WMI class](\u003chttps://msdn.microsoft.com/en-us/library/windows/desktop/aa394173(v=vs.85).aspx\u003e)\n\n## License\n\n[MIT](LICENSE)\n\n[npm-image]: https://badge.fury.io/js/%40dropb%2Fdiskinfo.svg\n[npm-url]: https://www.npmjs.com/package/@dropb/diskinfo\n[test-image]: https://github.com/kukhariev/diskinfo/workflows/Node%20CI/badge.svg\n[test-url]: https://github.com/kukhariev/diskinfo\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkukhariev%2Fdiskinfo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkukhariev%2Fdiskinfo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkukhariev%2Fdiskinfo/lists"}