How to use console-browserify - 10 common examples

To help you get started, we’ve selected a few console-browserify 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 danawoodman / starter / src / frontend / customers / store.js View on Github external
onDestroy: function (id) {
    console.log('destroy customer:', id);

    socket.emit(
      'destroy customer',
      id,
      function (err, message) {
        if (err) {
          // TODO: Handle errors...
        }
        this.destroyCustomer(id);
      }.bind(this)
    );
  },
github danawoodman / starter / src / frontend / customers / store.js View on Github external
onUpdate: function (customer) {
    // Tell the socket we want to update the customers list.
    customer.saving = true;

    console.log('Preparing to update customer', customer);

    socket.emit(
      'update customer',
      customer,
      function (err, message) {
        console.log('UPDATE!');
        if (err) {
          console.error(err);
          // TODO: Handle errors...
        }

        this.updateCustomer(customer);
      }.bind(this)
    );
  },
github danawoodman / starter / src / backend / customers / router.js View on Github external
this.update = function (customer, callback) {
    console.log('update customer:', customer);

    var err = Customer.update(customer);

    if (err) {
      console.error('There was an error!', err);
      callback(err, null);
      return;
    }

    callback(null, 'Success!');

    // Let other sockets know the customer was updated.
    socket.broadcast.emit('customer updated', customer);
  };
github danawoodman / starter / src / backend / customers / router.js View on Github external
this.create = function (customer, callback) {
    console.log('new customer:', customer);

    // TODO: Need to handle failures in saving.
    var cust = Customer.create({
      name: customer.name,
      email: customer.email
    });

    var err;
    if (err) {
      console.error('There was an error!', err);
      callback(err, null);
      return;
    }

    callback(null, cust);

    // Let other sockets know the customer was created.
    socket.broadcast.emit('customer created', cust);
  };
github danawoodman / starter / src / backend / customers / router.js View on Github external
this.destroy = function (id, callback) {
    console.log('delete customer:', id);

    var err = Customer.destroy(id);

    if (err) {
      console.error('There was an error!', err);
      callback(err, null);
      return;
    }

    callback(null, 'Success!');

    // Let other sockets know the customer was destroyed.
    socket.broadcast.emit('customer destroyed', id);
  };
github massyao / china-invalid-vaccine-flow / js / model / vaccine-counts-model.js View on Github external
//console.log("country is ",country);
    if (!country) {
        return {vaccine_countApplications: 0};
    } else if (!country[yearIndex]) {
        console.log('nothing found for year ' + yearIndex + ', debugInfo: ' + // eslint-disable-line
            debugInfo + ', stamp ' + endStamp);
        return {vaccine_countApplications: 0};
    } else {
        try {
            let data = Math.round(country[yearIndex][monthIndex].totalArrivedAtStartOfMonth +
                dayOfMonth * country[yearIndex][monthIndex].arrivingPerDay);
            return {
                vaccine_countApplications: data
            };
        } catch (e) {
            console.log(e);
        }


    }
};
github lucified / lucify-refugees / src / js / model / refugee-counts-model.js View on Github external
RefugeeCountsModel.prototype._prepareTotalCount = function(item, endStamp, debugInfo) {
  var mom = moment(new Date(endStamp * 1000));

  if (mom.isAfter(refugeeConstants.DATA_END_MOMENT)) {
    mom = refugeeConstants.DATA_END_MOMENT; // show last available data once we reach it
  }

  var dayOfMonth = mom.date();
  var yearIndex = mom.year() - refugeeConstants.DATA_START_YEAR;
  var monthIndex = mom.month();
  var country = item;

  if (!country) {
    return { asylumApplications: 0 };
  } else if (!country[yearIndex]) {
    console.log('nothing found for year ' + yearIndex + ', debugInfo: ' + // eslint-disable-line
      debugInfo + ', stamp ' + endStamp);
    return { asylumApplications: 0 };
  } else {
    return {
      asylumApplications: Math.round(country[yearIndex][monthIndex].totalArrivedAtStartOfMonth +
        dayOfMonth * country[yearIndex][monthIndex].arrivingPerDay)
    };
  }
};
github danawoodman / starter / src / frontend / customers / store.js View on Github external
function (err, message) {
        console.log('UPDATE!');
        if (err) {
          console.error(err);
          // TODO: Handle errors...
        }

        this.updateCustomer(customer);
      }.bind(this)
    );
github danawoodman / starter / src / frontend / customers / store.js View on Github external
init: function () {
    console.log('Initialize customer store.');
    // Fetch customers on initial load.
    socket.on('read customers', this.updateList.bind(this));

    // Listen for updates from other connected sockets.
    socket.on('customer created', this.createCustomer.bind(this));
    socket.on('customer updated', this.updateCustomer.bind(this));
    socket.on('customer destroyed', this.destroyCustomer.bind(this));
  },
github massyao / china-invalid-vaccine-flow / js / model / vaccine-counts-model.js View on Github external
VaccineCountsModel.prototype._prepareTotalCount = function (item, endStamp, debugInfo) {
    var mom = moment(new Date(endStamp * 1000));

    if (mom.isAfter(vaccineConstants.DATA_END_MOMENT)) {
        mom = vaccineConstants.DATA_END_MOMENT; // show last available data once we reach it
    }

    var dayOfMonth = mom.date();
    var yearIndex = mom.year() - vaccineConstants.DATA_START_YEAR;
    var monthIndex = mom.month();
    var country = item;
//console.log("country is ",country);
    if (!country) {
        return {vaccine_countApplications: 0};
    } else if (!country[yearIndex]) {
        console.log('nothing found for year ' + yearIndex + ', debugInfo: ' + // eslint-disable-line
            debugInfo + ', stamp ' + endStamp);
        return {vaccine_countApplications: 0};
    } else {
        try {
            let data = Math.round(country[yearIndex][monthIndex].totalArrivedAtStartOfMonth +
                dayOfMonth * country[yearIndex][monthIndex].arrivingPerDay);
            return {
                vaccine_countApplications: data
            };
        } catch (e) {
            console.log(e);
        }


    }
};

console-browserify

Emulate console for all the browsers

MIT
Latest version published 5 years ago

Package Health Score

68 / 100
Full package analysis

Similar packages