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

sourcetree-cli

v0.2.1

Published

View your sourcecode in browser like an ide

Downloads

2

Readme

Sourcetree

Sourcetree builds a static site from your source code, which has goto definition, hover, etc. So you can view source code inside your browser, like a full featured ide. You can see dogfooding demo here which contains source code of this repository.

How to use

  1. Generate a LSIF dump from your repository.
  2. Install a fairly new nodejs (the one on OS repository is usually old)
  3. npm install -g sourcetree-cli
  4. sourcetree dump.lsif -o out
  5. Your static site is ready in out directory. You can serve it via http-server or python3 -m http.server.

Features

  • current:
    • File tree of the source code (so Sourcetree is the name)
    • Hover
    • Go to definition
    • Find all references of a token
  • planned:

Relation with Sourcegraph

Sourcegraph is a wonderful tool, which Sourcetree is inspired by, but it isn't a one-size-fit-all solution. Sourcegraph targets "monorepo with loads of code", so they have a dedicated backend with databases and complex setup. So with Sourcegraph you should go either with sourcegraph.com which is a third-party service, or host a sourcegraph instance yourself which needs infrastructure.

On the other hand, Sourcetree enables a subset of Sourcegraph features with a bunch of static html files, which you can build it in CI and serve it via github pages or similars. So you can use it offline with local builds, include it inside your project website, manipulating html files in the desired way, ...

Sourcetree is something between Sourcegraph and nothing. Trees are graphs with no cycles, so they are a simple kind of graphs, and Sourcetree is a simple kind of Sourcegraph.

Features of Sourcegraph that Sourcetree will never get:

  • Anything between repositiories and global, like searching something in all codes in world
  • Anything about version control. Sourcetree take a tree of source code as input, and it doesn't even assume that there is a VCS. So it can't show info about history and other branches. You can use them together otherway, for example building a Sourcetree for every PR
  • Complex searchs, like search by regex (basic searching and indexing is possible even with static site)