Comparing version 0.0.2 to 0.1.0
@@ -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. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
8683
94
49
0