question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

README's demo code has wrong

See original GitHub issue

https://github.com/caolan/async#autotasks-concurrency-callback

async.auto({
    get_data: function(callback){
        console.log('in get_data');
        // async code to get some data
        callback(null, 'data', 'converted to array');
    },
    make_folder: function(callback){
        console.log('in make_folder');
        // async code to create a directory to store a file in
        // this is run at the same time as getting the data
        callback(null, 'folder');
    },
    write_file: ['get_data', 'make_folder', function(results, callback){
        console.log('in write_file', JSON.stringify(results));
        // once there is some data and the directory exists,
        // write the data to a file in the directory
        callback(null, 'filename');
    }],
    email_link: ['write_file', function(results, callback){
        console.log('in email_link', JSON.stringify(results));
        // once the file is written let's email a link to it...
        // results.write_file contains the filename returned by write_file.
        callback(null, {'file':results.write_file, 'email':'user@example.com'});
    }]
}, function(err, results) {
    console.log('err = ', err);
    console.log('results = ', results);
});

In this case, the write_file’s and email_link’s function should be function(callback, results){}

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
daweilvcommented, Apr 18, 2016

From the readme : If a task function has no dependencies, it will only be passed a callback.

0reactions
456wyccommented, Apr 20, 2016

@code4funlnyx Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] Code blocks are not properly rendered in the README ...
I'm using the same example as you have on your demo app README.md. This is the code I add to the readme file:...
Read more >
Error Pages - ReadMe Documentation
Add an error code link to a doc page by selecting the page in your project dashboard, then selecting API Error in the...
Read more >
README File – Everything you Need to Know - Great Learning
A README file is a text file that describes and launches a project. It comprises information that is frequently needed to grasp the...
Read more >
How can I test what my readme.md file will look like before ...
Since VS Code is platform independent, this would work for Windows, Mac and Linux. To switch between views, press Ctrl+Shift+V in the editor....
Read more >
How to Write a Good README File for Your GitHub Project
Between you and me, I created the account because I was told every developer should have one where they push their code. For...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found