Getting 'data' value from a Promise

getting synonym thesaurus
getting ready
get synonym
obtaining
define obtain
define acquire
getting in spanish
getting syllables

I have the following code:

let blob = repo.getBlob(sha, function(){
    console.log("===== BLOB =====");
    console.log(blob);
});

Which outputs the following Promise:

The only information I need from this Promise is the 'data' line:

What do I need to print in order to get just that value?

Seems like repo.getBlob(sha) returns a promise, then you can do:

repo.getBlob(sha).then(data=> console.log(data))

Or you can try

repo.getBlob(sha, function(err, data){
    console.log("===== BLOB =====");
    console.log(data);
});

getting, EXAMPLES FROM THE WEB FOR GETTING. He's getting old, and he's come along into his second childhood. "And you're getting it so  get: [verb] to gain possession of. to receive as a return : earn.

You probably have to do like this:

let blob = repo.getBlob(sha, function (error, data) {
    console.log("===== BLOB =====");
    console.log(data);
});

Or you can try this:

repo.getBlob(sha).then(function (data) {
    console.log(data);
});

Getting Synonyms, Getting Antonyms, 261 synonyms of getting from the Merriam-Webster Thesaurus, plus 366 related words, definitions, and antonyms. Find another word for getting. getting definition: 1. present participle of get 2. present participle of get . Learn more.

Looks like you're using nodegit library.

So according to the nodegit API documentation you have to call getBlob method this way:

repository.getBlob(String).then(function(blob) {
  // Use blob
});

Good luck!

GETTING, getting meaning: 1. present participle of get 2. present participle of get . Learn more. Getting definition: Getting is the present participle of → get 1 . | Meaning, pronunciation, translations and examples

GET (verb) definition and synonyms, It's getting late – I have to go. If that spot gets any bigger you should go to the doctor. get wet/cold/tired/ill etc: It was raining and we all got wet. get angry/upset etc  getting (plural gettings) The act of obtaining or acquiring; acquisition. Bible, Proverbs iv. 7 With all thy getting, get understanding.

getting, Exercise scientists and coaches offer tips on getting young people to be more active. Synonyms for getting in Free Thesaurus. Antonyms for getting. 1 synonym for getting: acquiring. What are synonyms for getting?

Getting Kids to Move More, Getting definition: Getting is the present participle of → get 1 . | Meaning, pronunciation, translations and examples. A short term of getting drunk(hucked) Get the getting neck gaiter and mug.

Comments
  • You're probably supposed to do repo.getBlob(sha).then(data => ...)…?!
  • It's unlikely that you can use blob.data the way @brae commented, since blob will not have that data at the time of reaching the console.log