code-coverage-dependencies
v0.4.0
Published
Check if your code is up to date with your dependencies
Readme
Code Coverage Dependencies
Check if your code is up to date with your dependencies
API
load(object:config)
- src: a glob string or a buffer
It creates a new instance for a report.
Api instance
get()
It returns a promise.
Promise success args: {tree: <Object>, latest: <Array>}
- tree is the dependency tree for your app
- latest is an array of last updated depenencies (<= 1 day)
- files an object with two keys:
- dependencies: list of names for the last updated dependencies
- files: list of dependencies names depending on these latest updated dependencies (key dependencies)
Demo
#!/usr/bin/env node
'use strict';
var fs = require('fs');
var dependencies = require('code-coverage-dependencies');
var deps = dependencies
.load({
src: './src/js/**/**/*.js',
// src: fs.readFileSync('./app/js/app.js')
})
.get()
.then(function (data) {
console.log(JSON.stringify(data.tree, null, 2));
console.log(JSON.stringify(data.latest, null, 2));
console.log(JSON.stringify(data.files, null, 2));
return data.files.toUpdate;
})
.then(ngDeps.render);
- Set a glob or a buffer for the source input
- Fetch informations for dependencies
- Display some informations about them
- The full dependencies tree
- Latest updated dependencies object tree
- Latest updated dependencies name and the list of depending ones
