Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify example code to work out of the box #365

Closed
wants to merge 1 commit into from

Conversation

camow7
Copy link

@camow7 camow7 commented Mar 4, 2020

When testing the old example code I would get the following error:

const drives = await drivelist.list();
^^^^^
SyntaxError: await is only valid in async function

I have modified the example code so you can cut, paste and run without error.

const drives = await drivelist.list();
drives.forEach((drive) => {
console.log(drive);
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the indentation.
You also need to add a footer to your commit message:


Change-type: patch

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not a failure. You just have to add async to the function callback ...

When testing the old example code I would get the following error:

const drives = await drivelist.list();
               ^^^^^
SyntaxError: await is only valid in async function

I have modified the example code so you can cut, paste and run without error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants