New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

count-files

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

count-files - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

18

index.js

@@ -7,5 +7,6 @@ var fs = require('fs')

function countFiles (dir, opts, cb) {
if (typeof(opts) === 'function') return countFiles(dir, null, opts)
if (typeof (opts) === 'function') return countFiles(dir, null, opts)
var filter = opts && opts.filter || function (filename) { return true }
if (!opts) opts = {}
var filter = opts.filter || function (filename) { return true }
var count = {

@@ -32,6 +33,13 @@ files: 0,

fs.stat(filePath, function (err, stats) {
if (err) return cb(err)
if (err && err.code === 'ENOENT') {
// symlinks
pending -= 1
if (!pending) return cb(null, count)
return
} else if (err) {
cb(err)
}
if (stats.isDirectory()) {
count.dirs += 1
countFiles(filePath, function (err, res) {
countFiles(filePath, opts, function (err, res) {
if (err) return cb(err)

@@ -53,2 +61,2 @@ count.dirs += res.dirs

})
}
}
{
"name": "count-files",
"version": "1.0.0",
"version": "1.0.1",
"description": "count files in a directory recursively",

@@ -5,0 +5,0 @@ "main": "index.js",

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