{"id":15020803,"url":"https://github.com/cristiammercado/node-disk-info","last_synced_at":"2025-05-09T00:03:36.065Z","repository":{"id":36618974,"uuid":"228275256","full_name":"cristiammercado/node-disk-info","owner":"cristiammercado","description":"Node module to get disk information in Windows, Linux, Mac, FreeBSD \u0026 OpenBSD (works with Electron).","archived":false,"fork":false,"pushed_at":"2023-01-07T04:35:40.000Z","size":199,"stargazers_count":63,"open_issues_count":15,"forks_count":16,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-09T00:02:14.702Z","etag":null,"topics":["disk","disk-information","disk-space","electron","linux","macos","module","node","nodejs","npm","windows"],"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/cristiammercado.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":"2019-12-16T00:55:06.000Z","updated_at":"2025-02-18T10:12:13.000Z","dependencies_parsed_at":"2023-01-17T03:10:45.657Z","dependency_job_id":null,"html_url":"https://github.com/cristiammercado/node-disk-info","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cristiammercado%2Fnode-disk-info","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cristiammercado%2Fnode-disk-info/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cristiammercado%2Fnode-disk-info/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cristiammercado%2Fnode-disk-info/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cristiammercado","download_url":"https://codeload.github.com/cristiammercado/node-disk-info/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253166502,"owners_count":21864475,"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":["disk","disk-information","disk-space","electron","linux","macos","module","node","nodejs","npm","windows"],"created_at":"2024-09-24T19:55:40.012Z","updated_at":"2025-05-09T00:03:35.732Z","avatar_url":"https://github.com/cristiammercado.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node disk info\n\nNode module to get disk information in Windows, Linux, Mac, FreeBSD \u0026 OpenBSD. It works with Electron. The library will call system command to get drives info, parse the results and load info in array. Inspired by [diskinfo](https://github.com/BenoitGauthier/diskinfo).\n\n[![Build Status](https://travis-ci.org/cristiammercado/node-disk-info.svg?branch=master)](https://travis-ci.org/cristiammercado/node-disk-info)\n[![npm version](https://badge.fury.io/js/node-disk-info.svg)](https://badge.fury.io/js/node-disk-info)\n\n## Installation\n\n`npm install --save node-disk-info`\n\n## Usage\n\nSee the [example script](example/index.js) for usage. You can run it with `npm run example`.\n\n```js\n// const nodeDiskInfo = require('node-disk-info'); =\u003e Use this when install as a dependency\nconst nodeDiskInfo = require('./dist/index');\n\n// async way\nnodeDiskInfo.getDiskInfo()\n    .then(disks =\u003e {\n        printResults('ASYNC WAY', disks);\n    })\n    .catch(reason =\u003e {\n        console.error(reason);\n    });\n\n// sync way\ntry {\n    const disks = nodeDiskInfo.getDiskInfoSync();\n    printResults('SYNC WAY', disks);\n} catch (e) {\n    console.error(e);\n}\n\nfunction printResults(title, disks) {\n\n    console.log(`============ ${title} ==============\\n`);\n\n    for (const disk of disks) {\n        console.log('Filesystem:', disk.filesystem);\n        console.log('Blocks:', disk.blocks);\n        console.log('Used:', disk.used);\n        console.log('Available:', disk.available);\n        console.log('Capacity:', disk.capacity);\n        console.log('Mounted:', disk.mounted, '\\n');\n    }\n\n}\n```\n\nOutput (example run on Windows):\n\n```\n============ SYNC WAY ==============\n\nFilesystem: Disco fijo local\nBlocks: 119387713536\nUsed: 109906608128\nAvailable: 9481105408\nCapacity: 92%\nMounted: C:\n\nFilesystem: Disco fijo local\nBlocks: 925015994368\nUsed: 639386984448\nAvailable: 285629009920\nCapacity: 69%\nMounted: D:\n\nFilesystem: Disco CD-ROM\nBlocks: 0\nUsed: 0\nAvailable: 0\nCapacity: 0%\nMounted: E:\n\n============ ASYNC WAY ==============\n\nFilesystem: Disco fijo local\nBlocks: 119387713536\nUsed: 109906608128\nAvailable: 9481105408\nCapacity: 92%\nMounted: C:\n\nFilesystem: Disco fijo local\nBlocks: 925015994368\nUsed: 639386984448\nAvailable: 285629009920\nCapacity: 69%\nMounted: D:\n\nFilesystem: Disco CD-ROM\nBlocks: 0\nUsed: 0\nAvailable: 0\nCapacity: 0%\nMounted: E:\n```\n\n## Release History \u0026 Changelog\n\nSee the [Releases](https://github.com/cristiammercado/node-disk-info/releases) page for a list of all releases, including changes.\n\n## Help / Support\n\nIf you run into any issues, please email me at [contact@cristiammercado.com](mailto:contact@cristiammercado.com) or you can use the contact form in [my page](https://www.cristiammercado.com/en/#contact).\n\nFor bug reports, please [open an issue on GitHub](https://github.com/cristiammercado/node-disk-info/issues/new).\n\n## Contributing\n\n1. [Fork it](https://github.com/cristiammercado/node-disk-info).\n2. Create your feature branch (`git checkout -b my-new-feature`).\n3. Commit your changes (`git commit -am 'Added some feature'`).\n4. Push to the branch (`git push origin my-new-feature`).\n5. Create a new Pull Request.\n\n## License\n\n[MIT](https://github.com/cristiammercado/node-disk-info/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcristiammercado%2Fnode-disk-info","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcristiammercado%2Fnode-disk-info","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcristiammercado%2Fnode-disk-info/lists"}