check number lines of code changed
$ npm install --save loc-down
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
});
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 donebranch
{String}
name of the branch to diff againstloc
{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 booleanisReasonable
being true/false if the loc difference is lte/gt theloc
parameter respectively.catch(error => {})
- promise is rejected if some error was encountered when attempting to diff agianstrepo/branch
MIT © Nick Bartlett