JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q37635F
  • License MIT

Get kloc for project.

Package Exports

  • kloc

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (kloc) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

KLOC

Get kloc for a software program.

install

# globallyyarn global add kloc

# or in projectyarn add kloc

usage

cli

❯ kloc ~/code/my-app

KLOC: 41.912

❯ kloc --exclude node_modules,.git

KLOC: 0.632

nodejs

const get_kloc = require('kloc')

get_kloc('.', { exclude: 'node_modules,.git', show_logs: true })
    .then(kloc => console.log(`\nKLOC: ${kloc}`))
    .catch(err => console.error(err.message))

// output:
//
// Got 9 files!
//
// - src/fs.js - [31] lines.
// - src/index.js - [31] lines.
// - LICENSE - [22] lines.
// - README.md - [63] lines.
// - cli.js - [40] lines.
// - index.js - [2] lines.
// - package.json - [16] lines.
// - test.js - [6] lines.
// - yarn.lock - [441] lines.
//
// KLOC: 0.652

api

kloc(path, options?)

Returns a number.

options

type: object

  • exclude

    type: string

    List of files & dirs to be excluded, separated by , (no spaces). Deep folder/file reference works too (e.g. app/node_modules).

  • show_logs

    type: boolean | default: false

    If true, lists each file that affected the total count.

license

MIT