{"_id":"get-folder-size","_rev":"3372223","name":"get-folder-size","description":"Get the size of a folder by iterating through its sub-files and -folders.","dist-tags":{"latest":"5.0.0"},"maintainers":[{"name":"alessioalex","email":"alexandru.vladutu@gmail.com"},{"name":"atjn","email":""}],"time":{"modified":"2024-08-26T02:55:35.000Z","created":"2014-05-25T09:07:41.540Z","5.0.0":"2024-07-20T22:18:10.298Z","4.0.0":"2022-07-27T21:34:11.610Z","3.1.0":"2021-05-06T07:58:01.594Z","3.0.1":"2021-04-21T11:20:35.988Z","3.0.0":"2021-04-15T11:23:47.477Z","2.0.1":"2019-01-21T10:43:12.333Z","2.0.0":"2018-05-03T10:42:06.258Z","1.0.1":"2018-01-10T08:21:10.589Z","1.0.0":"2015-10-23T09:18:02.259Z","0.1.1":"2014-12-18T16:19:20.971Z","0.1.0":"2014-05-25T09:07:41.540Z"},"users":{},"author":{"name":"Alexandru Vladutu","email":"alexandru.vladutu@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/alessioalex/get-folder-size.git"},"versions":{"5.0.0":{"name":"get-folder-size","version":"5.0.0","description":"Get the size of a folder by iterating through its sub-files and -folders.","type":"module","exports":{".":{"types":"./index.d.ts","default":"./index.js"}},"bin":{"get-folder-size":"bin/get-folder-size.js"},"engines":{"node":">=18.11.0"},"devDependencies":{"@eslint/js":"^9.7.0","@types/eslint__js":"^8.42.3","eslint":"^9.7.0","globals":"^15.8.0","memfs":"^4.9.3","prettier":"^3.3.3","tap":"^21.0.0","typescript":"^5.5.3","typescript-eslint":"^8.0.0-alpha.46"},"scripts":{"tap":"tap","lint":"eslint \"**/*.{ts,js}\" --fix","lint:nofix":"eslint \"**/*.{ts,js}\"","format":"prettier --write .","format:nofix":"prettier --check .","test":"npm run lint:nofix && npm run tap"},"keywords":["folder","directory","size"],"repository":{"type":"git","url":"git+https://github.com/alessioalex/get-folder-size.git"},"author":{"name":"Alexandru Vladutu","email":"alexandru.vladutu@gmail.com"},"license":"MIT","_id":"get-folder-size@5.0.0","gitHead":"4df10b2ec67f207019a1e012476e2985eede99f2","types":"./index.d.ts","bugs":{"url":"https://github.com/alessioalex/get-folder-size/issues"},"homepage":"https://github.com/alessioalex/get-folder-size#readme","_nodeVersion":"22.4.0","_npmVersion":"10.8.2","dist":{"shasum":"554a248ec8315871f89d467244f52b4c9f94cde1","size":4337,"noattachment":false,"key":"/get-folder-size/-/get-folder-size-5.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/get-folder-size/download/get-folder-size-5.0.0.tgz"},"_npmUser":{"name":"atjn","email":"dev@atjn.dk"},"directories":{},"maintainers":[{"name":"alessioalex","email":"alexandru.vladutu@gmail.com"},{"name":"atjn","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/get-folder-size_5.0.0_1721513890136_0.40015372842744035"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-07-20T22:18:10.298Z","publish_time":1721513890298,"_source_registry_name":"default","_cnpm_publish_time":1721513890298},"4.0.0":{"name":"get-folder-size","version":"4.0.0","description":"Get the size of a folder by iterating through its sub-files and -folders.","type":"module","main":"./index.js","exports":"./index.js","bin":{"get-folder-size":"bin/get-folder-size.js"},"engines":{"node":">=14.13.0"},"dependencies":{"gar":"^1.0.4"},"devDependencies":{"eslint":"^8.20.0","memfs":"^3.4.6","tap":"^16.3.0"},"scripts":{"tap":"tap --no-coverage","lint":"eslint \"**/*.js\" --fix","lint:nofix":"eslint \"**/*.js\"","test":"npm run lint:nofix && npm run tap"},"keywords":["folder","directory","size"],"repository":{"type":"git","url":"git+https://github.com/alessioalex/get-folder-size.git"},"author":{"name":"Alexandru Vladutu","email":"alexandru.vladutu@gmail.com"},"license":"MIT","gitHead":"3302eb169b5159847c67bf6e9f14a6e6b9d1eb59","bugs":{"url":"https://github.com/alessioalex/get-folder-size/issues"},"homepage":"https://github.com/alessioalex/get-folder-size#readme","_id":"get-folder-size@4.0.0","_nodeVersion":"18.7.0","_npmVersion":"8.15.0","dist":{"shasum":"d73eedb4b2fa9144a3b5a115909d129e1ba8300a","size":3946,"noattachment":false,"key":"/get-folder-size/-/get-folder-size-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/get-folder-size/download/get-folder-size-4.0.0.tgz"},"_npmUser":{"name":"atjn","email":"dev@atjn.dk"},"directories":{},"maintainers":[{"name":"alessioalex","email":"alexandru.vladutu@gmail.com"},{"name":"atjn","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/get-folder-size_4.0.0_1658957651378_0.9084221050786527"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-07-27T21:34:14.431Z","publish_time":1658957651610,"_cnpm_publish_time":1658957651610},"3.1.0":{"name":"get-folder-size","version":"3.1.0","description":"Get the size of a folder by iterating through its sub-files and -folders.","type":"module","main":"./index.js","exports":"./index.js","bin":{"get-folder-size":"bin/get-folder-size.js"},"engines":{"node":">=14.13.0"},"dependencies":{"gar":"^1.0.4"},"devDependencies":{"memfs":"^3.2.2","tap":"^15.0.6"},"scripts":{"test":"tap --no-coverage"},"keywords":["folder","directory","size"],"repository":{"type":"git","url":"git+https://github.com/alessioalex/get-folder-size.git"},"author":{"name":"Alexandru Vladutu","email":"alexandru.vladutu@gmail.com"},"license":"MIT","gitHead":"a9041d4d0db1bd55be97acd4dffd57c045016e9c","bugs":{"url":"https://github.com/alessioalex/get-folder-size/issues"},"homepage":"https://github.com/alessioalex/get-folder-size#readme","_id":"get-folder-size@3.1.0","_nodeVersion":"14.16.1","_npmVersion":"6.14.12","dist":{"shasum":"96d39f7e1a0b2e30d13958e05373ebfa32bdfaa4","size":3718,"noattachment":false,"key":"/get-folder-size/-/get-folder-size-3.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/get-folder-size/download/get-folder-size-3.1.0.tgz"},"_npmUser":{"name":"atjn","email":"dev@atjn.dk"},"directories":{},"maintainers":[{"name":"alessioalex","email":"alexandru.vladutu@gmail.com"},{"name":"atjn","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/get-folder-size_3.1.0_1620287881482_0.40803474233844184"},"_hasShrinkwrap":false,"publish_time":1620287881594,"_cnpm_publish_time":1620287881594,"_cnpmcore_publish_time":"2021-12-16T19:09:44.091Z"},"3.0.1":{"name":"get-folder-size","version":"3.0.1","description":"Get the size of a folder by iterating through its sub-files and -folders.","type":"module","main":"index.js","bin":{"get-folder-size":"bin/get-folder-size.js"},"engines":{"node":">=14.13.0"},"dependencies":{"gar":"^1.0.4"},"devDependencies":{"memfs":"^3.2.2","tap":"^15.0.4"},"scripts":{"test":"tap --no-coverage"},"keywords":["folder","directory","size"],"repository":{"type":"git","url":"git+https://github.com/alessioalex/get-folder-size.git"},"author":{"name":"Alexandru Vladutu","email":"alexandru.vladutu@gmail.com"},"license":"MIT","gitHead":"7354ac3d75c3d6917fad5c9b21cf47ec48ab4175","bugs":{"url":"https://github.com/alessioalex/get-folder-size/issues"},"homepage":"https://github.com/alessioalex/get-folder-size#readme","_id":"get-folder-size@3.0.1","_nodeVersion":"14.16.1","_npmVersion":"6.14.12","dist":{"shasum":"a5319e55f449845ed102e8dbbb16c521d88dd4a0","size":3706,"noattachment":false,"key":"/get-folder-size/-/get-folder-size-3.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/get-folder-size/download/get-folder-size-3.0.1.tgz"},"_npmUser":{"name":"atjn","email":"dev@atjn.dk"},"directories":{},"maintainers":[{"name":"alessioalex","email":"alexandru.vladutu@gmail.com"},{"name":"atjn","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/get-folder-size_3.0.1_1619004035788_0.17385125852485817"},"_hasShrinkwrap":false,"publish_time":1619004035988,"_cnpm_publish_time":1619004035988,"_cnpmcore_publish_time":"2021-12-16T19:09:44.288Z"},"3.0.0":{"name":"get-folder-size","version":"3.0.0","description":"Get the size of a folder by iterating through its sub-files and -folders.","type":"module","main":"index.js","bin":{"get-folder-size":"bin/get-folder-size.js"},"engines":{"node":">=14.13.0"},"dependencies":{"gar":"^1.0.4"},"devDependencies":{"memfs":"^3.2.2","tap":"^15.0.2"},"scripts":{"test":"tap --no-coverage"},"keywords":["folder","directory","size"],"repository":{"type":"git","url":"git+https://github.com/alessioalex/get-folder-size.git"},"author":{"name":"Alexandru Vladutu","email":"alexandru.vladutu@gmail.com"},"license":"MIT","gitHead":"bc57a61bf3fb3d94236008c60e3cc5eef4344a08","bugs":{"url":"https://github.com/alessioalex/get-folder-size/issues"},"homepage":"https://github.com/alessioalex/get-folder-size#readme","_id":"get-folder-size@3.0.0","_nodeVersion":"14.16.1","_npmVersion":"6.14.12","dist":{"shasum":"0bb06def5702d21164b074ba97b54d94de5ecc9d","size":3485,"noattachment":false,"key":"/get-folder-size/-/get-folder-size-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/get-folder-size/download/get-folder-size-3.0.0.tgz"},"_npmUser":{"name":"alessioalex","email":"npm@services.alessioalex.com"},"directories":{},"maintainers":[{"name":"alessioalex","email":"alexandru.vladutu@gmail.com"},{"name":"atjn","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/get-folder-size_3.0.0_1618485827342_0.9091119488257255"},"_hasShrinkwrap":false,"publish_time":1618485827477,"_cnpm_publish_time":1618485827477,"_cnpmcore_publish_time":"2021-12-16T19:09:44.555Z"},"2.0.1":{"name":"get-folder-size","version":"2.0.1","description":"Get the size of a folder by recursively iterating through all its sub(files && folders).","main":"index.js","bin":{"get-folder-size":"bin/get-folder-size"},"dependencies":{"gar":"^1.0.4","tiny-each-async":"2.0.3"},"devDependencies":{"husky":"^0.10.1","mocha":"^5.2.0","proxyquire":"^1.7.3","should":"^7.1.1"},"scripts":{"test":"mocha","precommit":"npm test"},"keywords":["folder","size"],"repository":{"type":"git","url":"git+https://github.com/alessioalex/get-folder-size.git"},"author":{"name":"Alexandru Vladutu","email":"alexandru.vladutu@gmail.com"},"license":"MIT","gitHead":"9034cb09d474f023245ca549ea4a294a43d1a84f","bugs":{"url":"https://github.com/alessioalex/get-folder-size/issues"},"homepage":"https://github.com/alessioalex/get-folder-size#readme","_id":"get-folder-size@2.0.1","_nodeVersion":"10.14.0","_npmVersion":"6.6.0","dist":{"shasum":"3fe0524dd3bad05257ef1311331417bcd020a497","size":2320,"noattachment":false,"key":"/get-folder-size/-/get-folder-size-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/get-folder-size/download/get-folder-size-2.0.1.tgz"},"maintainers":[{"name":"alessioalex","email":"alexandru.vladutu@gmail.com"},{"name":"atjn","email":""}],"_npmUser":{"name":"alessioalex","email":"npm@services.alessioalex.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/get-folder-size_2.0.1_1548067392271_0.7947967940688825"},"_hasShrinkwrap":false,"publish_time":1548067392333,"_cnpm_publish_time":1548067392333,"_cnpmcore_publish_time":"2021-12-16T19:09:44.896Z"},"2.0.0":{"name":"get-folder-size","version":"2.0.0","description":"Get the size of a folder by recursively iterating through all its sub(files && folders).","main":"index.js","bin":{"get-folder-size":"bin/get-folder-size"},"dependencies":{"gar":"^1.0.2","tiny-each-async":"2.0.3"},"devDependencies":{"husky":"^0.10.1","mocha":"^2.3.3","proxyquire":"^1.7.3","should":"^7.1.1"},"scripts":{"test":"mocha","precommit":"npm test"},"keywords":["folder","size"],"repository":{"type":"git","url":"git+https://github.com/alessioalex/get-folder-size.git"},"author":{"name":"Alexandru Vladutu","email":"alexandru.vladutu@gmail.com"},"license":"MIT","gitHead":"d699ecd309b63ea6a152d92e3a02ba59319962c0","bugs":{"url":"https://github.com/alessioalex/get-folder-size/issues"},"homepage":"https://github.com/alessioalex/get-folder-size#readme","_id":"get-folder-size@2.0.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.2","_npmUser":{"name":"alessioalex","email":"npm@services.alessioalex.com"},"dist":{"shasum":"f0ecb4aa30ea855e051366714eaabcc41cf9d43f","size":2307,"noattachment":false,"key":"/get-folder-size/-/get-folder-size-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/get-folder-size/download/get-folder-size-2.0.0.tgz"},"maintainers":[{"name":"alessioalex","email":"alexandru.vladutu@gmail.com"},{"name":"atjn","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/get-folder-size_2.0.0_1525344126194_0.7287334767940588"},"_hasShrinkwrap":false,"publish_time":1525344126258,"_cnpm_publish_time":1525344126258,"_cnpmcore_publish_time":"2021-12-16T19:09:45.151Z"},"1.0.1":{"name":"get-folder-size","version":"1.0.1","description":"Get the size of a folder by recursively iterating through all its sub(files && folders).","main":"index.js","bin":{"get-folder-size":"bin/get-folder-size"},"dependencies":{"async":"^1.4.2","gar":"^1.0.2"},"devDependencies":{"alessioalex-standard":"^1.0.0","husky":"^0.10.1","mocha":"^2.3.3","proxyquire":"^1.7.3","should":"^7.1.1"},"scripts":{"test":"mocha","lint":"alessioalex-standard","precommit":"npm run lint && npm test"},"keywords":["folder","size"],"repository":{"type":"git","url":"git+https://github.com/alessioalex/get-folder-size.git"},"author":{"name":"Alexandru Vladutu","email":"alexandru.vladutu@gmail.com"},"license":"MIT","gitHead":"6d490616ebf94cff0aa91fc411175d5bc42971b2","bugs":{"url":"https://github.com/alessioalex/get-folder-size/issues"},"homepage":"https://github.com/alessioalex/get-folder-size#readme","_id":"get-folder-size@1.0.1","_shasum":"802fa4208434de71205182b15ab7f1352088e580","_from":".","_npmVersion":"4.6.1","_nodeVersion":"6.9.4","_npmUser":{"name":"alessioalex","email":"npm@services.alessioalex.com"},"dist":{"shasum":"802fa4208434de71205182b15ab7f1352088e580","size":2326,"noattachment":false,"key":"/get-folder-size/-/get-folder-size-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/get-folder-size/download/get-folder-size-1.0.1.tgz"},"maintainers":[{"name":"alessioalex","email":"alexandru.vladutu@gmail.com"},{"name":"atjn","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/get-folder-size-1.0.1.tgz_1515572470521_0.9216020414605737"},"directories":{},"publish_time":1515572470589,"_hasShrinkwrap":false,"_cnpm_publish_time":1515572470589,"_cnpmcore_publish_time":"2021-12-16T19:09:45.369Z"},"1.0.0":{"name":"get-folder-size","version":"1.0.0","description":"Get the size of a folder by recursively iterating through all its sub(files && folders).","main":"index.js","bin":{"get-folder-size":"bin/get-folder-size"},"dependencies":{"async":"^1.4.2","minimist":"^1.2.0"},"devDependencies":{"alessioalex-standard":"^1.0.0","husky":"^0.10.1","mocha":"^2.3.3","proxyquire":"^1.7.3","should":"^7.1.1"},"scripts":{"test":"mocha","lint":"alessioalex-standard","precommit":"npm run lint && npm test"},"keywords":["folder","size"],"repository":{"type":"git","url":"git+https://github.com/alessioalex/get-folder-size.git"},"author":{"name":"Alexandru Vladutu","email":"alexandru.vladutu@gmail.com"},"license":"MIT","gitHead":"5edbc381901428a869e33fd026f11137bb6d0da1","bugs":{"url":"https://github.com/alessioalex/get-folder-size/issues"},"homepage":"https://github.com/alessioalex/get-folder-size#readme","_id":"get-folder-size@1.0.0","_shasum":"134d663a0e745611b72f71c83b13f1b12f31ba29","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"alessioalex","email":"alexandru.vladutu@gmail.com"},"dist":{"shasum":"134d663a0e745611b72f71c83b13f1b12f31ba29","size":2321,"noattachment":false,"key":"/get-folder-size/-/get-folder-size-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/get-folder-size/download/get-folder-size-1.0.0.tgz"},"maintainers":[{"name":"alessioalex","email":"alexandru.vladutu@gmail.com"},{"name":"atjn","email":""}],"directories":{},"publish_time":1445591882259,"_hasShrinkwrap":false,"_cnpm_publish_time":1445591882259,"_cnpmcore_publish_time":"2021-12-16T19:09:45.659Z"},"0.1.1":{"name":"get-folder-size","version":"0.1.1","description":"Get the size of a folder by recursively iterating through all its sub(files && folders).","main":"index.js","bin":{"get-folder-size":"bin/get-folder-size"},"dependencies":{"async":"~0.9.0","minimist":"~0.1.0"},"devDependencies":{"mocha":"~1.19.0","proxyquire":"~1.0.0","should":"~3.3.2"},"scripts":{"test":"mocha"},"keywords":["folder","size"],"repository":{"type":"git","url":"https://github.com/alessioalex/get-folder-size.git"},"author":{"name":"Alexandru Vladutu","email":"alexandru.vladutu@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/alessioalex/get-folder-size/issues"},"homepage":"https://github.com/alessioalex/get-folder-size","_id":"get-folder-size@0.1.1","dist":{"shasum":"d1b84c5100bf96a7c51380ea3ce040022108a8a0","size":2128,"noattachment":false,"key":"/get-folder-size/-/get-folder-size-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/get-folder-size/download/get-folder-size-0.1.1.tgz"},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"alessioalex","email":"alexandru.vladutu@gmail.com"},"maintainers":[{"name":"alessioalex","email":"alexandru.vladutu@gmail.com"},{"name":"atjn","email":""}],"directories":{},"publish_time":1418919560971,"_hasShrinkwrap":false,"_cnpm_publish_time":1418919560971,"_cnpmcore_publish_time":"2021-12-16T19:09:45.872Z"},"0.1.0":{"name":"get-folder-size","version":"0.1.0","description":"Get the size of a folder by recursively iterating through all its sub(files && folders).","main":"index.js","bin":{"get-folder-size":"bin/get-folder-size"},"dependencies":{"async":"~0.9.0","minimist":"~0.1.0"},"devDependencies":{"mocha":"~1.19.0","proxyquire":"~1.0.0","should":"~3.3.2"},"scripts":{"test":"mocha"},"keywords":["folder","size"],"repository":{"type":"git","url":"https://github.com/alessioalex/get-folder-size.git"},"author":{"name":"Alexandru Vladutu","email":"alexandru.vladutu@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/alessioalex/get-folder-size/issues"},"homepage":"https://github.com/alessioalex/get-folder-size","_id":"get-folder-size@0.1.0","dist":{"shasum":"807b1c9d4eb24d5376fd3cf4d3244e914d4283e7","size":2051,"noattachment":false,"key":"/get-folder-size/-/get-folder-size-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/get-folder-size/download/get-folder-size-0.1.0.tgz"},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"alessioalex","email":"alexandru.vladutu@gmail.com"},"maintainers":[{"name":"alessioalex","email":"alexandru.vladutu@gmail.com"},{"name":"atjn","email":""}],"directories":{},"publish_time":1401008861540,"_hasShrinkwrap":false,"_cnpm_publish_time":1401008861540,"_cnpmcore_publish_time":"2021-12-16T19:09:46.202Z"}},"readme":"# get-folder-size\n\nGet the size of a folder by iterating through its sub-files and -folders.\n\n## Basic usage\n\nIf you don't care about the details and just want a quick implementation, you can use:\n\n```js\ngetFolderSize.loose(\"/path/to/folder\");\n```\n\nExample:\n\n```js\nimport getFolderSize from \"get-folder-size\";\n\nconst myFolder = \"/path/to/my/folder\";\n\nconst size = await getFolderSize.loose(myFolder);\nconsole.log(`The folder is ${size} bytes large`);\nconsole.log(`That is the same as ${(size / 1000 / 1000).toFixed(2)} MB`);\n```\n\n## Methods\n\nWhen reading the size of a folder, read errors can randomly occur for a number of reasons, especially if a different process is altering files in the same folder at the same time. There are three different ways to call this package, depending on how you want to handle those errors:\n\n### `getFolderSize(path, [options]): object`\n\nThe default method will return an object with the size of the folder and a list of encountered errors:\n\n```js\n{\n  size: 1435,\n  errors: [\n    Error{} ...\n  ]\n}\n```\n\nIf no errors were encountered, `errors` will be `null`. If errors were encountered, `size` will likely be smaller than the real folder size.\n\nThis method is great if you want to implement custom logic based on the errors that were encountered.\n\n### `getFolderSize.loose(path, [options]): number | bigint`\n\nThe `loose` method will return the folder size directly and ignore any errors it encounters, which means the returned folder size could be smaller than the real folder size.\n\nThis method is great if the precise size isn't too important, for example when used only to display the folder size to the user.\n\n### `getFolderSize.strict(path, [options]): number | bigint`\n\nThe `strict` method will return the folder size directly, but throw an error if it encounters any read errors.\n\nThis method is great if you need a very accurate number. You will have to implement some sort of error handling to use it reliably.\n\n## Options\n\nAny of the three methods can also take an `options` object:\n\n```js\ngetFolderSize(\"/path/to/folder\", {\n  bigint: true,\n  ignore: /pattern/,\n  fs: customFS,\n});\n```\n\nIf the `bigint` option is set to true, the folder size is returned as a BigInt instead of the default Number.\n\nThe `ignore` option takes a regex pattern. Any file or folder with a path that matches the pattern will not be counted in the total folder size.\n\nThe `fs` option allows you to pass a different filesystem handler, such as [memfs](https://github.com/streamich/memfs), that will be used to read the folder size. The filesystem handler must incorporate `lstat` and `readdir` promise functions.\n\n## CLI tool\n\nYou can run this module from your command line:\n\n```bash\nget-folder-size --folder \"/my/folder\" --ignore \"node_modules\"\n```\n\nThe optional `ignore` statement takes a regex pattern.\n\n## FAQ\n\n### I don't care if I have a file or folder, I just want to get the size.\n\nIf a file is passed to `get-folder-size`, it will simply return the size of the file. This means you can use it as a catch-all to get the size of any element in the filesystem.\n\nExample:\n\n```js\nimport getItemSize from \"get-folder-size\";\n\nfor (const path of [\n  \"/path/to/small/file.txt\",\n  \"/path/to/small/folder/\",\n  \"/path/to/large/file.js\",\n  \"/path/to/large/folder/\",\n]) {\n  console.log(await getItemSize.strict(path));\n}\n\n// Console:\n// 273\n// 402\n// 348614\n// 674362319\n```\n\n### Does it return actual size or size on disk?\n\nThis module calculates the actual folder size, and not the size on disk. [Read about the difference here.](https://web.archive.org/web/20140712235443/https://stackoverflow.com/questions/15470787/please-help-me-understand-size-vs-size-on-disk)\n\n### How do I import it from a CommonJS module?\n\nCommonJS modules do not support the `import..from` method, but they do support this method:\n\n```js\nconst getFolderSize = (await import(\"get-folder-size\")).default;\n```\n\nNote that this import only works inside an async function.\n\nIf you want to use the `require` method, consider just staying on v2. You can make v2 return a promise by importing it this way:\n\n```js\nconst util = require(\"util\");\nconst getFolderSize = util.promisify(require(\"get-folder-size\"));\n```\n\nIf none of these methods work for you, [send us a detailed explanation of your issue](https://github.com/alessioalex/get-folder-size/issues), and we will take a look at it.\n\n### How do I use it?\n\nThis is a Node module. If you are not sure what that means, please check out one of the many great tutorials online, like [nodejs.dev](https://nodejs.dev/learn/introduction-to-nodejs).\n\nWhen you have Node set up, you can install `get-folder-size` from your command line with this command:\n\n```bash\nnpm install get-folder-size\n```\n\nYou can now import it into your JavaScript files, or you can use its command line interface (CLI).\n\n## License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/alessioalex/get-folder-size#readme","bugs":{"url":"https://github.com/alessioalex/get-folder-size/issues"},"license":"MIT"}