How to use the cliff.putObject function in cliff

To help you get started, we’ve selected a few cliff 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 flatiron / commandful / lib / commandful / controller.js View on Github external
prompt.get(schema, function (err, result) {
      if(err) {
        return;
      }
      logger.info('about to save ' + resource.lowerResource.magenta);
      cliff.putObject(result);
      result.id = record.id;
      confirm(function(err, promptResult){
        resource.update(record.id, result, function(err, r){
          if(err) {
            return logger.error(JSON.stringify(err))
          }
          logger.info('saved ' + resource.lowerResource.magenta + ' ' + r.id.grey)
        })
      });
    });
  });
github flatiron / commandful / lib / commandful / controller.js View on Github external
resource.get(id, function(err, record){
    if(err) {
      logger.error(JSON.stringify(err))
      return;
    }
    var schema = utile.clone(resource.schema);
    logger.info('about to destroy ' + resource.lowerResource.magenta + ' ' + record.id);
    cliff.putObject(record);
    confirm(function(err, promptResult){
      resource.destroy(record.id, function(err, r){
        if(err) {
          logger.error(JSON.stringify(err))
          return;
        }
        logger.info('destroyed' + ' ' + r.id.magenta)
      });
    });
  });
};
github bigcompany / big / node_modules / big-command / lib / command / controller.js View on Github external
resource.get(id, function(err, result){
      if(err) {
        logger.error(JSON.stringify(err))
        return;
      }
      logger.info('showing ' + id.magenta);
      cliff.putObject(result);
    });
  } else {
github bigcompany / big / node_modules / big-command / lib / command / controller.js View on Github external
resource.get(id, function(err, record){
      if(err) {
        logger.error(JSON.stringify(err))
        return;
      }
      logger.info('about to destroy ' + resource.name.magenta + ' ' + record.id);
      cliff.putObject(record);
      confirm(function(err, promptResult){
        resource.destroy(record.id, function(err, r){
          if(err) {
            logger.error(JSON.stringify(err))
            return;
          }
          logger.info('destroyed' + ' ' + record.id.magenta)
        });
      });
    });
  } else {

cliff

Your CLI formatting friend.

MIT
Latest version published 10 years ago

Package Health Score

56 / 100
Full package analysis