#!/usr/bin/env node

"use strict";

var getWantedDependencies = require("./");

getWantedDependencies(__dirname, function(err, wantedDependencies) {
  if (err) {
    console.error(err);
    process.exit(1);
  }

  wantedDependencies.forEach(dependency => {
    console.log(dependency.name + " (" + dependency.wantedVersion + ")");
  });
});

#!/usr/bin/env node

"use strict";

var getWantedDependencies = require("./");

getWantedDependencies(__dirname).then(function(wantedDependencies) {
  wantedDependencies.forEach(function(dependency) {
    console.log(dependency.name + " (" + dependency.wantedVersion + ")");
  });
}).catch(function(err) {
  console.error(err);
  process.exit(1);
});

Use a Promise-based approach in cli.js