mirror of
https://github.com/bower/bower.git
synced 2026-01-15 01:08:07 -05:00
24 lines
740 B
JavaScript
24 lines
740 B
JavaScript
// ==========================================
|
|
// BOWER: read-json.js - with logging fun
|
|
// ==========================================
|
|
// Copyright 2012 Twitter, Inc
|
|
// Licensed under The MIT License
|
|
// http://opensource.org/licenses/MIT
|
|
// ==========================================
|
|
|
|
var readJSON = require('read-package-json');
|
|
var template = require('./template');
|
|
|
|
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(path, cb);
|
|
} |