Socket
Socket
Sign inDemoInstall

3h-count

Package Overview
Dependencies
19
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    3h-count

A utility program that displays some information about the given file(s).


Version published
Weekly downloads
2
increased by100%
Maintainers
1
Install size
517 kB
Created
Weekly downloads
 

Changelog

Source

0.1.1

  • Fix missing placeholder for root option.

Readme

Source

3h-count

A utility program that displays some information about the given file(s).

  • Changelog
  • License (ISC)

Example

$ 3h-count src/**/*.*
[summary]
fileCount: 4
totalLineCount: 228
emptyLineCount: 30
nonemptyLineCount: 198

CLI Usage

$ 3h-count --help
A utility program that displays some information about the given file(s).

Usage:
  3h-count <action> [options] -- [globs...]

Actions:
  <globs...>                    File(s) to include.

Options:
  --help, -h                    Show help info.
  --mode, -m <file|project>     Display mode. (default: project)
  --file, -f                    Shortcut for "--mode file".
  --project, -p                 Shortcut for "--mode project".
  --root, -r <path>             The root directory in which to search.
  --include-dot-files, -d       Include files whose name begin with a period.
  --no-summary, -S              Omit summary section in file mode.
  -- [globs...]                 Additional file(s) to include.

Progammatical Usage

export interface CountFileOptions {
    filePath: string;
    /**
     * @default {false}
     */
    noDisplay?: boolean;
}

export interface CountFileResult {
    totalLineCount: number;
    emptyLineCount: number;
    nonemptyLineCount: number;
}

export declare const countFile: (options: CountFileOptions) => Promise<CountFileResult>;

export type CountGlobMode = 'file' | 'project';

export interface CountGlobOptions {
    pattern: string[] | string;
    /**
     * @default {'project'}
     */
    mode?: CountGlobMode;
    cwd?: string;
    /**
     * @default {false}
     */
    noDisplay?: boolean;
    /**
     * @default {false}
     */
    noSummary?: boolean;
    /**
     * @default {false}
     */
    includeDotFiles?: boolean;
}

export interface CountGlobResult {
    results: CountFileResult[];
    fileCount: number;
    totalLineCount: number;
    emptyLineCount: number;
    nonemptyLineCount: number;
}

export declare const countGlob: (options: CountGlobOptions) => Promise<CountGlobResult>;

Keywords

FAQs

Last updated on 26 Aug 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc