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

fcount

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fcount - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

test/fixtures/.hidden/no.java

2

bin/count.js

@@ -5,3 +5,3 @@ #!/usr/bin/env node

var argv = require('minimist')(process.argv.slice(2));
var count = require('../src/count.js')(argv._);
var count = require('../src/count.js')(argv);

@@ -8,0 +8,0 @@ // provide clean output on exceptions rather than dumping a stack trace

{
"name": "fcount",
"version": "0.1.0",
"version": "0.2.0",
"description": "Recursively count the number files in a directory given a pattern to match on.",

@@ -34,4 +34,5 @@ "preferGlobal": "true",

"devDependencies": {
"mocha": "~1.20.1"
"mocha": "~1.20.1",
"chai": "~1.9.1"
}
}

@@ -51,4 +51,3 @@ fcount

- TESTS. It's 1.20am right now, need to come back and do later!

@@ -10,13 +10,20 @@ var fs = require('fs');

//
var file_counts = {};
var file_counts;
var table = new Table({
head: ['File type', 'Count'],
//colWidths: [100, 200]
head: ['File type', 'Count']
});
function count(extensions) {
copy_to_obj(extensions);
function count(args, cb, dir) {
dir = dir || null;
file_counts = {};
walk(process.cwd(), function(err) {
if (!(args._.length > 0)) {
var message = chalk.red('Error: ') + chalk.yellow('fcount expects at least one extension to be passed in.');
return cb ? cb(message) : console.log(message);
}
copy_to_obj(args._);
walk(dir, function(err) {
if (err) return console.log(err);

@@ -30,3 +37,7 @@

console.log(table.toString());
if (args.d) {
return cb ? cb(file_counts) : file_counts;
} else {
return cb ? cb(table.toString()) : console.log(table.toString());
}
});

@@ -94,3 +105,3 @@ }

});
})(process.cwd());
})(process.cwd() + (dir || ''));
}

@@ -97,0 +108,0 @@

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