Replies: 2 comments
-
| Welcome @peter17! 
 This indicates you have the file marked as CJS. | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            -
| Thank you very much! It is working fine, now, with  Best regards | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
I have a JSON file which is a estree AST. I need to serialize it to JavaScript.
I am trying to use https://github.com/syntax-tree/estree-util-to-js for this, but I am not a JavaScript developer and I don't understand how to have the example code run... (copied below from the README):
I saved that code to test.js and I installed estree-util-to-js using NPM but when I run
node test.jsI getSyntaxError: Cannot use import statement outside a moduleI copied the code to test.html and replaced a line with
import {toJs} from 'https://esm.sh/estree-util-to-js@2?bundle'but I can't do the same fornode:fs/promises...Any help, please? Thanks a lot in advance. Best regards
Beta Was this translation helpful? Give feedback.
All reactions