doublemarked / loopback-console

A command-line tool for Loopback app debugging and administration
MIT License
68 stars 6 forks source link

Support async/await #12

Closed jaysson closed 6 years ago

jaysson commented 7 years ago

Is it possible to wrap the console prompt in an async IIFE, so that we can use await inside?

doublemarked commented 7 years ago

Can you elaborate a bit on your needs? The console already replaces Promise handles returned by functions with resolutions, which is quite similar to what await does. Perhaps you have a more complex use case?

Example of Promise resolution,

loopback > w = Widget.create({ name: 'myWidget01', description: 'My new Widget'})
{ name: 'myWidget01', description: 'My new Widget', id: 1 }
loopback > Widget.count()
1