npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

estraverse-browser

v1.0.1

Published

Browser-ready standalone build of Estraverse ( UMD + ESM )

Readme

estraverse-browser

This package provides estraverse bundled for use in the browser without the need to npm install anything

you can use this tool to see what is exposed in both the script src and esm modules

global state diff -- https://ext-code.com/utils/misc/global-state-diff/global-state-diff.html

see also https://www.npmjs.com/package/espree-browser for espree


For script


      <script src='https://libs.ext-code.com/external/js/estraverse/estraverse.js'></script>
      

test it out with this tool

html editor -- https://ext-code.com/utils/editors/html-editor/html-editor.html


For esm


      import {estraverse} from 'https://libs.ext-code.com/external/js/estraverse/estraverse.m.js';

      //
      
      var {estraverse}    = await import('https://libs.ext-code.com/external/js/estraverse/estraverse.m.js');

test it out with this tool

js console -- https://ext-code.com/utils/editors/js-console/js-console.html


Further Reading

https://github.com/estools/estraverse

https://www.npmjs.com/package/estraverse


examples

            
      <script type=module>
      
      
            import {espree} from 'https://libs.ext-code.com/external/js/espree/espree.m.js';
            import {estraverse} from 'https://libs.ext-code.com/external/js/estraverse/estraverse.m.js';
            
            
            const code    = `
            
                  function greet(name) {
                    console.log("Hello " + name);
                  }
                  
                  const add = (a, b) => a + b;
                  
            `;
      
      
            const options   = {
                	                                                                    // attach range information to each node
                	range               : false,
                	                                                                    // attach line/column location information to each node
                	loc                 : false,
                	                                                                    // create a top-level comments array containing all comments
                	comment             : false,
                	                                                                    // create a top-level tokens array containing all tokens
                	tokens              : false,
                
                                                                                    	// Set to 3, 5 (the default), 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
                                                                                    	// 16 or 17 to specify the version of ECMAScript syntax you want to use.
                                                                                    	// You can also set to 2015 (same as 6), 2016 (same as 7),
                                                                                    	// 2017 (same as 8), 2018 (same as 9), 2019 (same as 10),
                                                                                    	// 2020 (same as 11), 2021 (same as 12), 2022 (same as 13),
                                                                                    	// 2023 (same as 14), 2024 (same as 15), 2025 (same as 16) or
                                                                                    	// 2026 (same as 17) to use the year-based naming.
                                                                                    	// You can also set "latest" to use the most recently supported version.
                	ecmaVersion        : 'latest',
                                                                                      // only allowed when ecmaVersion is 3
                	//allowReserved     : true, 
                	                                                                    // specify which type of script you're parsing ("script",
                	                                                                    // "module", or "commonjs")
                	sourceType         : "module",
                	                                                                    // specify additional language features
                	ecmaFeatures       : {
                		                                                                  // enable JSX parsing
                		                        jsx             : false,
                		                                                                  // enable return in global scope (set to true automatically
                		                                                                  // when sourceType is "commonjs")
                		                        globalReturn    : false,
                		                                                                  // enable implied strict mode (if ecmaVersion >= 5)
                		                        impliedStrict   : false,
                	                     },
            };
      
      
            const ast   = espree.parse(code,options);
            
            console.log(ast);    
            console.log(JSON.stringify(ast,null,4));      
            
            
            estraverse.traverse(ast,{
              
                  enter(node,parent){
                                                                                // Log entering a node
                                                                                console.log(`→ Enter: ${node.type}`);
                        if(node.type==='FunctionDeclaration'){
                                                                                console.log('  FunctionDeclaration:', node.id?.name);
                        }
              
                        if( node.type==='VariableDeclarator' &&
                            node.init &&
                            (node.init.type==='ArrowFunctionExpression' ||
                             node.init.type==='FunctionExpression')
                        ){
                                                                                console.log('  Function assigned to variable:', node.id.name);
                        }
                  },
              
                  leave(node, parent) {
                                                                                // Log leaving a node
                                                                                console.log(`← Leave: ${node.type}`);
                  }
            });
            
      
      
      </script>
      

      
      var {espree}        = await import('https://libs.ext-code.com/external/js/espree/espree.m.js');
      var {estraverse}    = await import('https://libs.ext-code.com/external/js/estraverse/estraverse.m.js');
      
      const code    = `
      
            function greet(name) {
              console.log("Hello " + name);
            }
            
            const add = (a, b) => a + b;
            
      `;
      
      const ast   = espree.parse(code,{
            ecmaVersion     : 'latest',
            sourceType      : 'module',
            ecmaFeatures    : {jsx:true}
      });
      
      
      console.log(ast);    
      console.log(JSON.stringify(ast,null,4));

      
  
      estraverse.traverse(ast,{
        
            enter(node,parent){
                                                                          // Log entering a node
                                                                          console.log(`→ Enter: ${node.type}`);
                  if(node.type==='FunctionDeclaration'){
                                                                          console.log('  FunctionDeclaration:', node.id?.name);
                  }
        
                  if( node.type==='VariableDeclarator' &&
                      node.init &&
                      (node.init.type==='ArrowFunctionExpression' ||
                       node.init.type==='FunctionExpression')
                  ){
                                                                          console.log('  Function assigned to variable:', node.id.name);
                  }
            },
        
            leave(node, parent) {
                                                                          // Log leaving a node
                                                                          console.log(`← Leave: ${node.type}`);
            }
      });


      <script src='https://libs.ext-code.com/external/js/espree/espree.js'></script>
      <script src='https://libs.ext-code.com/external/js/estraverse/estraverse.js'></script>
      
      <script>

            const code    = `
            
                  function greet(name) {
                        console.log("Hello " + name);
                  }
                  
                  const add = (a, b) => a + b;
                  
            `;
      
            const ast   = espree.parse(code,{ecmaVersion:'latest',sourceType:'module',});

                                                                                console.log(ast);    
                                                                                console.log(JSON.stringify(ast,null,4));      

            estraverse.traverse(ast,{
              
                  enter(node,parent){
                                                                                // Log entering a node
                                                                                console.log(`→ Enter: ${node.type}`);
                        if(node.type==='FunctionDeclaration'){
                                                                                console.log('  FunctionDeclaration:', node.id?.name);
                        }
              
                        if( node.type==='VariableDeclarator' &&
                            node.init &&
                            (node.init.type==='ArrowFunctionExpression' ||
                             node.init.type==='FunctionExpression')
                        ){
                                                                                console.log('  Function assigned to variable:', node.id.name);
                        }
                  },
              
                  leave(node, parent) {
                                                                                // Log leaving a node
                                                                                console.log(`← Leave: ${node.type}`);
                  }
            });
      
      </script>