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 🙏

© 2024 – Pkg Stats / Ryan Hefner

tern-local-scope-condense-plugin

v0.0.8

Published

Tern plugin for including local scope entries in condenser output

Downloads

10

Readme

tern-local-scope-condense-plugin

A tern plugin for including local scope entries in condenser output.

The tern condenser is designed to "condense" a set of JavaScript files into a concise and type-inferred description of their public API. It doesn't include local variables or any other entries not reachable by an external caller.

This plugin hooks into the condenser to output such information. It's useful if you wish to have a near-complete representation of the structure of a JavaScript program, for static analysis tools (such as Sourcegraph).

Documentation on Sourcegraph

Build Status status authors Total views

Usage

To install dependencies, run npm install.

With the tern condenser

Load the plugin:

$ node_modules/tern/bin/condense --plugin local-scope-condense testdata/simple.js

You'll see information about local scope entries in the condensed output:

{
  "!name": "testdata/simple.js",
  "!define": {
    "g.!local": {
      "0": {
        "j": {
          "!span": "146[10:12]-147[10:13]"
        }
      },
      "3": {
        "h": {
          "!span": "116[8:17]-117[8:18]"
        },
        "i": {
          "!type": "number",
          "!span": "127[9:6]-128[9:7]"
        }
      }
    },
    "z.x.y.!local": {
      "0": {
        "zz": {
          "!type": "number",
          "!span": "184[14:25]-186[14:27]"
        }
      }
    },
    "!local": {
      "testdata/simple`js": {
        "0": {
          "c": {
            "!span": "40[2:13]-41[2:14]"
          },
          "d": {
            "!span": "53[3:8]-54[3:9]"
          }
        },
        "3": {
          "f": {
            "!span": "87[5:19]-88[5:20]"
          }
        },
        "6": {
          "a": {
            "!type": "number",
            "!span": "20[1:6]-21[1:7]"
          },
          "b": {
            "!type": "fn(c: ?)",
            "!span": "38[2:11]-39[2:12]"
          },
          "e": {
            "!type": "fn(f: ?)",
            "!span": "74[5:6]-75[5:7]"
          }
        },
        "g": {
          "!type": "fn(h: ?)",
          "!span": "103[8:4]-104[8:5]"
        },
        "z": {
          "!type": "z",
          "!span": "163[14:4]-164[14:5]"
        }
      }
    }
  },
  "g": {
    "!type": "fn(h: ?)",
    "!span": "103[8:4]-104[8:5]"
  },
  "z": {
    "x": {
      "y": {
        "!type": "fn(zz: number)",
        "!span": "172[14:13]-173[14:14]"
      },
      "!span": "168[14:9]-169[14:10]"
    },
    "!span": "163[14:4]-164[14:5]"
  }
}

Running tests

Run npm test.

Authors

Contributions are welcome! Submit a GitHub issue or pull request.