<commit_before>#!/usr/bin/env node
'use strict';

const updateNotifier = require('update-notifier');

const meow = require('meow');
const isString = require('util').isString;
const spaceHogs = require('./');

const cli = meow({
    inferType: true,
    description: 'Discover surprisingly large directories.',
    help:
`
    Usage
      space-hogs [path] [size] [--depth=number]

    Options
      directory        Directory to scan. Defaults to the current directory.
      size             Minimum size in MB. Defaults to 6% of the total MB.
      --depth=number   Number of sub-directories to dive into. 0 = none. Defaults to all.

    Examples

      $ space-hogs
      $ space-hogs node_modules 5 --depth=0
      $ space-hogs 1000

`});


updateNotifier({pkg: cli.pkg}).notify();

const userInterestingSizeMB = cli.input.find(Number.isInteger);
const startPath = cli.input.find(isString);
const maxDepth = cli.flags.depth;

spaceHogs({startPath, userInterestingSizeMB, maxDepth}).then(process.exit);<commit_msg>fix lint<commit_after>#!/usr/bin/env node
'use strict';

const updateNotifier = require('update-notifier');
const meow = require('meow');
const isString = require('util').isString;
const spaceHogs = require('./');

const cli = meow({
    inferType: true,
    description: 'Discover surprisingly large directories.',
    help:
`
    Usage
      space-hogs [path] [size] [--depth=number]

    Options
      directory        Directory to scan. Defaults to the current directory.
      size             Minimum size in MB. Defaults to 6% of the total MB.
      --depth=number   Number of sub-directories to dive into. 0 = none. Defaults to all.

    Examples

      $ space-hogs
      $ space-hogs node_modules 5 --depth=0
      $ space-hogs 1000

`});

updateNotifier({pkg: cli.pkg}).notify();

const userInterestingSizeMB = cli.input.find(Number.isInteger);
const startPath = cli.input.find(isString);
const maxDepth = cli.flags.depth;

spaceHogs({startPath, userInterestingSizeMB, maxDepth}).then(process.exit);
{'fraction_non_alphanumeric': 0.123334977799704, 'fraction_numerical': 0.007893438579181056, 'mean_word_length': 3.2966101694915255, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2899926', 'n_tokens_mistral': 653, 'n_tokens_neox': 617, 'n_words': 176}