Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

du

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

du - npm Package Compare versions

Comparing version 0.0.2 to 0.1.0

8

index.js

@@ -18,4 +18,6 @@ /* Copyright (c) 2012 Rod Vagg <@rvagg> */

var size = options.disk ? (512 * stat.blocks) : stat.size
if (!stat.isDirectory())
return callback(null, !options.filter || options.filter(dir) ? stat.size : 0)
return callback(null, !options.filter || options.filter(dir) ? size : 0)

@@ -37,3 +39,3 @@ fs.readdir(dir, function (err, list) {

return p + s
}, stat.size)
}, size)
)

@@ -46,2 +48,2 @@ }

module.exports = du
module.exports = du
{
"authors" : [
"Rod Vagg @rvagg <rod@vagg.org> (https://github.com/rvagg)"
]
, "name": "du"
, "description": "A simple JavaScript implementation of `du -sb`"
, "keywords": [ "du", "size" ]
, "version": "0.0.2"
, "main": "index.js"
, "bin": {
"dujs": "./du.js"
}
, "scripts": {
"test": "node tests.js"
}
, "dependencies": {
"async": "~0.1.22"
}
, "devDependencies": {
"mkfiletree": "*"
}
, "repository" : {
"type" : "git"
, "url" : "https://github.com/rvagg/node-du.git"
}
"authors": [
"Rod Vagg @rvagg <rod@vagg.org> (https://github.com/rvagg)"
],
"name": "du",
"description": "A simple JavaScript implementation of `du -sb`",
"keywords": [
"du",
"size"
],
"version": "0.1.0",
"main": "index.js",
"bin": {
"dujs": "./du.js"
},
"scripts": {
"test": "node tests.js"
},
"dependencies": {
"async": "~0.1.22"
},
"devDependencies": {
"mkfiletree": "*"
},
"repository": {
"type": "git",
"url": "https://github.com/rvagg/node-du.git"
}
}

@@ -14,3 +14,5 @@ # node-du

An optional `options` object may be passed as the second argument. Currently there is only one option, a `'filter'` function that is passed a full file path and is expected to return a truthy/falsy value to indicate whether the file is included in size calculations.
An optional `options` object may be passed as the second argument. Currently there is only two options,
a `'filter'` function that is passed a full file path and is expected to return a truthy/falsy value to indicate whether the file is included in size calculations
and a `disk` option. If disk is true, then block sizing is used when calculating the size. (get's you closer to real du numbers).

@@ -47,2 +49,2 @@ ```js

OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc