{"_id":"@sindresorhus/df","_rev":"1253330","name":"@sindresorhus/df","description":"Get free disk space info from `df -kP`","dist-tags":{"latest":"4.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2021-10-14T10:21:00.000Z","created":"2015-05-04T19:52:18.160Z","4.0.0":"2021-10-14T10:06:43.272Z","3.1.1":"2019-06-30T08:47:24.646Z","3.1.0":"2019-03-31T10:38:37.500Z","3.0.0":"2019-03-11T07:41:21.100Z","2.1.0":"2016-06-16T20:45:00.115Z","2.0.0":"2016-04-11T21:07:41.966Z","1.0.1":"2015-05-04T19:52:18.160Z"},"users":{},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/df.git"},"versions":{"4.0.0":{"name":"@sindresorhus/df","version":"4.0.0","description":"Get free disk space info from `df -kP`","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/df.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["df","dfkp","df-kp","disk","space","free","info","data","fs","filesystem","file-system","drive","mount","size","capacity"],"dependencies":{"execa":"^5.1.1"},"devDependencies":{"ava":"^3.15.0","tsd":"^0.18.0","xo":"^0.45.0"},"gitHead":"3f471488e860071f0d59b62d6c5ef595abee6d54","bugs":{"url":"https://github.com/sindresorhus/df/issues"},"homepage":"https://github.com/sindresorhus/df#readme","_id":"@sindresorhus/df@4.0.0","_nodeVersion":"12.22.1","_npmVersion":"7.20.3","dist":{"shasum":"f780395d197827f0976e92db3ca0d838200f8178","size":3288,"noattachment":false,"key":"/@sindresorhus/df/-/@sindresorhus/df-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@sindresorhus/df/download/@sindresorhus/df-4.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/df_4.0.0_1634206003142_0.7966966530878961"},"_hasShrinkwrap":false,"publish_time":1634206003272,"_cnpm_publish_time":1634206003272},"3.1.1":{"name":"@sindresorhus/df","version":"3.1.1","description":"Get free disk space info from `df -kP`","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/df.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["df","dfkp","df-kp","disk","space","free","info","data","fs","filesystem","file-system","drive","mount","size","capacity"],"dependencies":{"execa":"^2.0.1"},"devDependencies":{"ava":"^2.1.0","tsd":"^0.7.1","xo":"^0.24.0"},"gitHead":"d6b69f2c40b8bdf9760ef33ab3bca2b204af0aff","bugs":{"url":"https://github.com/sindresorhus/df/issues"},"homepage":"https://github.com/sindresorhus/df#readme","_id":"@sindresorhus/df@3.1.1","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"94200f9277e4a7fdd35ce8ab8b6bc5b52b164d31","size":3075,"noattachment":false,"key":"/@sindresorhus/df/-/@sindresorhus/df-3.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/@sindresorhus/df/download/@sindresorhus/df-3.1.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/df_3.1.1_1561884444426_0.9361179855197934"},"_hasShrinkwrap":false,"publish_time":1561884444646,"_cnpm_publish_time":1561884444646},"3.1.0":{"name":"@sindresorhus/df","version":"3.1.0","description":"Get free disk space info from `df -kP`","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/df.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["df","dfkp","df-kp","disk","space","free","info","data","fs","filesystem","file-system","drive","mount","size","capacity"],"dependencies":{"execa":"^1.0.0"},"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.1","xo":"^0.24.0"},"gitHead":"5f8ca4ac1b34c5c8d72a03bbad81c97f772e951f","bugs":{"url":"https://github.com/sindresorhus/df/issues"},"homepage":"https://github.com/sindresorhus/df#readme","_id":"@sindresorhus/df@3.1.0","_nodeVersion":"8.15.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"968f6df0b1ff873a1ee6b11484d8bdf6cf0259eb","size":2753,"noattachment":false,"key":"/@sindresorhus/df/-/@sindresorhus/df-3.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@sindresorhus/df/download/@sindresorhus/df-3.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/df_3.1.0_1554028717364_0.6005752998230178"},"_hasShrinkwrap":false,"publish_time":1554028717500,"_cnpm_publish_time":1554028717500},"3.0.0":{"name":"@sindresorhus/df","version":"3.0.0","description":"Get free disk space info from `df -kP`","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/df.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd-check"},"keywords":["df","dfkp","df-kp","disk","space","free","info","data","fs","filesystem","file-system","drive","mount","size","capacity"],"dependencies":{"execa":"^1.0.0"},"devDependencies":{"ava":"^1.3.1","tsd-check":"^0.3.0","xo":"^0.24.0"},"gitHead":"277855ff337833d1a732373d5c150d8249e36e9b","bugs":{"url":"https://github.com/sindresorhus/df/issues"},"homepage":"https://github.com/sindresorhus/df#readme","_id":"@sindresorhus/df@3.0.0","_nodeVersion":"8.15.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"e6a9c88b39c9111240de9e1d94e9f48abf230c05","size":2704,"noattachment":false,"key":"/@sindresorhus/df/-/@sindresorhus/df-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@sindresorhus/df/download/@sindresorhus/df-3.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/df_3.0.0_1552290080778_0.9277966857622033"},"_hasShrinkwrap":false,"publish_time":1552290081100,"_cnpm_publish_time":1552290081100},"2.1.0":{"name":"@sindresorhus/df","version":"2.1.0","description":"Get free disk space info from `df -kP`","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/df.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"publishConfig":{"access":"public"},"files":["index.js"],"keywords":["df","dfkp","df-kp","disk","space","free","info","data","fs","filesystem","file-system","drive","mount","size","capacity"],"dependencies":{"execa":"^0.2.2"},"devDependencies":{"ava":"*","xo":"*"},"xo":{"esnext":true},"gitHead":"ea9be6d4f60fb7b8e0b38bb626c6454ce2974a14","bugs":{"url":"https://github.com/sindresorhus/df/issues"},"homepage":"https://github.com/sindresorhus/df#readme","_id":"@sindresorhus/df@2.1.0","_shasum":"d208cf27e06f0bb476d14d7deccd7d726e9aa389","_from":".","_npmVersion":"2.15.0","_nodeVersion":"4.4.2","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"d208cf27e06f0bb476d14d7deccd7d726e9aa389","size":2436,"noattachment":false,"key":"/@sindresorhus/df/-/@sindresorhus/df-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@sindresorhus/df/download/@sindresorhus/df-2.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/df-2.1.0.tgz_1466109899111_0.3926803059875965"},"directories":{},"publish_time":1466109900115,"_cnpm_publish_time":1466109900115,"_hasShrinkwrap":false},"2.0.0":{"name":"@sindresorhus/df","version":"2.0.0","description":"Get free disk space info from `df -kP`","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/df.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"publishConfig":{"access":"public"},"files":["index.js"],"keywords":["df","dfkp","df-kp","disk","space","free","info","data","fs","filesystem","file-system","drive","mount","size","capacity"],"dependencies":{"execa":"^0.2.2"},"devDependencies":{"ava":"*","xo":"*"},"xo":{"esnext":true},"gitHead":"95184d46d4d2113958ebc9a31c7ce5b5391e5291","bugs":{"url":"https://github.com/sindresorhus/df/issues"},"homepage":"https://github.com/sindresorhus/df#readme","_id":"@sindresorhus/df@2.0.0","_shasum":"4dca43ac7eba06618de8d0afa4d76224d0bdd313","_from":".","_npmVersion":"2.15.0","_nodeVersion":"4.4.2","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"4dca43ac7eba06618de8d0afa4d76224d0bdd313","size":2334,"noattachment":false,"key":"/@sindresorhus/df/-/@sindresorhus/df-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@sindresorhus/df/download/@sindresorhus/df-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/df-2.0.0.tgz_1460408859216_0.09315302595496178"},"directories":{},"publish_time":1460408861966,"_cnpm_publish_time":1460408861966,"_hasShrinkwrap":false},"1.0.1":{"name":"@sindresorhus/df","version":"1.0.1","description":"Get free disk space info from `df -kP`","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/df.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"node test.js"},"files":["index.js"],"keywords":["df","dfkp","df-kp","disk","space","free","info","data","fs","filesystem","file-system","drive","mount","size","capacity"],"devDependencies":{"ava":"0.0.4"},"gitHead":"d08cdc4d48a7cc0a36f01e741118e48549d407ae","bugs":{"url":"https://github.com/sindresorhus/df/issues"},"homepage":"https://github.com/sindresorhus/df#readme","_id":"@sindresorhus/df@1.0.1","_shasum":"c69b66f52f6fcdd287c807df210305dbaf78500d","_from":".","_npmVersion":"2.9.0","_nodeVersion":"0.10.38","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"c69b66f52f6fcdd287c807df210305dbaf78500d","size":2396,"noattachment":false,"key":"/@sindresorhus/df/-/@sindresorhus/df-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/@sindresorhus/df/download/@sindresorhus/df-1.0.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1430769138160,"_cnpm_publish_time":1430769138160,"_hasShrinkwrap":false}},"readme":"# df\n\n> Get free disk space info from [`df -kP`](https://en.wikipedia.org/wiki/Df_\\(Unix\\))\n\nWorks on any Unix-based system like macOS and Linux.\n\n*Created because all the other `df` wrappers are terrible. This one uses simple and explicit parsing. Uses `execFile` rather than `exec`. Ensures better platform portability by using the `-P` flag. Returns sizes in bytes instead of kilobytes and the capacity as a float.*\n\n## Install\n\n```sh\nnpm install @sindresorhus/df\n```\n\n## Usage\n\n```js\nimport {\n\tdiskSpace,\n\tdiskSpaceForFilesystem,\n\tdiskSpaceForFilesystemOwningPath\n} from '@sindresorhus/df';\n\nconsole.log(await diskSpace());\n/*\n[\n\t{\n\t\tfilesystem: '/dev/disk1',\n\t\ttype: 'ext4',\n\t\tsize: 499046809600,\n\t\tused: 443222245376,\n\t\tavailable: 55562420224,\n\t\tcapacity: 0.89,\n\t\tmountpoint: '/'\n\t},\n\t…\n]\n*/\n\nconsole.log(await diskSpaceForFilesystem('/dev/disk1'));\n/*\n{\n\tfilesystem: '/dev/disk1',\n\t…\n}\n*/\n\nconsole.log(await diskSpaceForFilesystemOwningPath('.'));\n/*\n{\n\tfilesystem: '/dev/disk1',\n\t…\n}\n*/\n```\n\n## API\n\n### diskSpace()\n\nReturns a `Promise<object[]>` with a list of space info objects for each filesystem.\n\n### diskSpaceForFilesystem(path)\n\nReturns a `Promise<object>` with the space info for the given filesystem path.\n\n- `filesystem` - Name of the filesystem.\n- `type` - Type of the filesystem. *(Not available on macOS)*\n- `size` - Total size in bytes.\n- `used` - Used size in bytes.\n- `available` - Available size in bytes.\n- `capacity` - Capacity as a float from `0` to `1`.\n- `mountpoint` - Disk mount location.\n\n#### path\n\nType: `string`\n\nA path to a [filesystem device file](https://en.wikipedia.org/wiki/Device_file). Example: `'/dev/disk1'`.\n\n### diskSpaceForFilesystemOwningPath(path)\n\nReturns a `Promise<object>` with the space info for the filesystem the given path is part of.\n\n#### path\n\nType: `string`\n\nA path to a file/directory on the filesystem to get the space info for.\n","_attachments":{},"homepage":"https://github.com/sindresorhus/df#readme","bugs":{"url":"https://github.com/sindresorhus/df/issues"},"license":"MIT"}