How to compile asynchronous callback results in babel plug-in?

  node.js, question
export default myplugin = ({ type:t }) => {
 let visitor = {
 stringLiteral ( path ) {
 asyncfn(path, result =>{
 // do something async
 // how can i get these async result into ast tree?
 })
 bracket
 bracket
 return {
 visitor
 bracket
 bracket

https://github.com/babel/babel.github.io/issues/762

After trying all kinds of methods, I found outdeasyncAt present, this package can realize asynchronous to synchronous transfer.

There are no side effects to say

"use strict";
 const deasync = require('deasync');
 
 function asyncfn(callback){
 //...pipe(...).pipe(...).pipe(...).on("finish",()=>callback(null,"haha"))
 bracket
 
 let asyncfnSync = deasync(asyncfn)
 
 export default myplugin = ({ type:t }) => {
 let visitor = {
 stringLiteral ( path ) {
 let result = asyncfnSyny(path.node)
 //haha  ..
 bracket
 bracket
 return {
 visitor
 bracket
 bracket

Reference link