loc-down

test lines of code

Usage no npm install needed!

<script type="module">
  import locDown from 'https://cdn.skypack.dev/loc-down';
</script>

README

loc-down NPM version Build Status Coverage Status dependencies Status devDependencies Status

check number lines of code changed

John Locke smiling

Installation

$ npm install --save loc-down

Usage

var locDown = require('loc-down');

locDown('git@github.com:tteltrab/loc-down.git', 'master', 200)
  .then(isReasonable => {
    // isReasonable is a boolean - true if <= 200 lines changed, false otherwise
  })
  .catch(error => {
    // error is whatever issue was encountered when trying to diff with the provided parameters
  });

locDown(repo, branch, loc)

Determine if loc difference from repo/branch is less than or equal to loc.

  • repo {String} url representation for the repo against which diffs will be done
  • branch {String} name of the branch to diff against
  • loc {Number} number which indicates the maximum lines of code which should be changed

Returns a promise:

  • .then(isReasonable => {}) - promise is resolved if the diff was successful, with the boolean isReasonable being true/false if the loc difference is lte/gt the loc parameter respectively
  • .catch(error => {}) - promise is rejected if some error was encountered when attempting to diff agianst repo/branch

License

MIT © Nick Bartlett