lib/models/bin.js
function (data, fn) {
    this.store.generateBinId(data.length, 0, function generateBinId(err, id) {
      if (err) {
        return fn(err);
      }

      data.url = id;
      data.revision = 1;
      data.latest = true;
      data.streamingKey = this.createStreamingKey(id, data.revision);
      this.store.setBin(data, function (err, id) {
        data.id = id;
        fn(err || null, err ? undefined : data);
      });
    }.bind(this));
  }
function (data, fn) {
    this.store.generateBinId(data.length, 0, function generateBinId(err, id) {
      if (err) {
        return fn(err);
      }

      data.url = id;
      data.revision = 1;
      data.latest = true;
      data.streamingKey = this.createStreamingKey(id, data.revision);
      this.store.setBin(data, function (err, id) {
        data.id = id;
        fn(err || null, err ? undefined : data);
      });
    }.bind(this));
  }
function ( data , fn ) { this . store . generateBinId ( data . length , 0 , function generateBinId ( err , id ) { if ( err ) { return fn ( err ) ; } data . url = id ; data . revision = 1 ; data . latest = true ; data . streamingKey = this . createStreamingKey ( id , data . revision ) ; this . store . setBin ( data , function ( err , id ) { data . id = id ; fn ( err || null , err ? undefined : data ) ; } ) ; } . bind ( this ) ) ; }
Create a new bin.
Create a new bin .