object-progress
v0.1.4
Published
know the percentage of advance of an object
Downloads
59
Readme
Object progress
know the percentage of advance of an object
Quick Start
Install:
$ npm i -S object-progress
Example:
const progress = require('object-progress')
const fix = 2
const validItems = ['name', 'email', 'age', 'city']
const doc = {
name: 'robot',
email: '[email protected]',
age: null,
city: ''
}
let { avg, count, invalid } = progress(validItems, doc, fix)
console.log(avg) // 0.60
console.log(count) // 3
console.log(invalid) // [ 'age', 'city' ]
Testing
$ npm test