node-sloc
Version:
A small tool for counting SLOC.
21 lines (20 loc) • 1.28 kB
TypeScript
import { Options, SLOCResult, Callback } from './types';
/**
* @typedef {Object} Options
* @property {string} path The path to walk or file to read.
* @property {Array} [extensions] Additional file extensions to look for.
* @property {Array} [ignorePaths] A list of directories to ignore.
* @property {boolean} [ignoreDefault] Ignores the default file extensions.
* @property {function} [logger] Outputs extra information to this function if specified.
*/
/**
* Reads a specified file/directory and counts the SLOC.
* If a directory is supplied the function will walk the directory recursively and count the SLOC.
* @param {Options} options The options. See object options.
* @param {Function} [callback] The callback function, if node-style callbacks are preferred over promises.
* @return {Promise} If no callback is supplied, it returns a promise which will resolve to an object with
* properties `sloc` and `paths` (or null if no path matched).
*/
declare const nodeSloc: (options: Options, callback?: Callback | undefined) => Promise<SLOCResult | null> | undefined;
export default nodeSloc;
export { nodeSloc as sloc };