How to use the read-package-json.log function in read-package-json

To help you get started, we’ve selected a few read-package-json examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TypeStrong / atom-typescript / node_modules / atom-package-dependencies / node_modules / witwip / witwip.js View on Github external
var path = require('path'),
    fs = require('fs'),
    exists = fs.exists || path.exists,
    existsSync = fs.existsSync || path.existsSync,
    debug = require('debug')('witwip'),
    readJSON = require('read-package-json'),
    modulePathCache = {};

readJSON.log = {
  info: function() {},
  verbose: function() {},
  warn: function() {}
};

module.exports = witwip;

function witwip(base, modulePath, callback) {
  // If only a callback is passed, then find the package.json of the caller.
  if (typeof base === 'function') {
    callback = base;
    modulePath = null;
    base = module.parent;
  }

  // Allow base to be a module object (such as `module.parent`).
github bower / bower / lib / util / read-json.js View on Github external
var read = module.exports = function (path, cb, obj) {
  readJSON.log = {
    info: function () {},
    verbose: function () {},
    warn: function (what, name, shizzle) {
      if (read.showWarnings) {
        template('warn', { name: name.replace(/@/, '#'), shizzle: shizzle })
          .on('data', obj.emit.bind(obj, 'data'));
      }
    }
  };
  readJSON.cache.reset();
  readJSON(path, cb);
};

read-package-json

The thing npm uses to read package.json files with semantics and defaults and validation

ISC
Latest version published 6 months ago

Package Health Score

64 / 100
Full package analysis

Similar packages