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 🙏

© 2025 – Pkg Stats / Ryan Hefner

petrie

v1.0.0

Published

a graph-based phylogenetic tree, implemented in Javascript.

Downloads

7

Readme

Petrie

petrie

a Graph-based phylogenetic tree, implemented in Javascript.

Phylogeny and Taxonomy

Whether your purposes are phylogenetic or taxonomic in nature doesn't matter. That is, whether you are making a evolutional tree, or a species classification tree. Your source of graph data will determine the utility.

  • https://en.wikipedia.org/wiki/Phylogenetic_tree
  • https://en.wikipedia.org/wiki/Taxonomic_rank

Graph

  • https://github.com/trekhleb/javascript-algorithms/tree/master/src/data-structures/graph

Implementation

todo

Nepenthes Example

I chose Nepenthes, because I grow them at home! This project is part of a bigger one related to carnivorous plants and terraria that I'm breaking apart.

  • http://www.carnivorousplants.org/cp/evolution/Nepenthes

I'm a hobbiest, so if youre actually in a scientific field and have favorite phylogenetic database, data structure, protocol to share this kind of data, or other research I know nothing about!, I'd love to hear about it in the issues.

Getting started

Install package.

yarn add petrie

Import module.

import Tree from 'petrie';

Create a cached tree from the ICPS Carnivorous Plant Names Database.

Create a cached tree using NCBS.

Creating your own tree.

Import your data.

import data from './data'; // default export location

Initialize a new Tree instance.

const tree = new Tree(data);

Searching.

tree.find('nepenthes');

tree.find('nepenthes a');

Taxonomy

const ampullaria = tree.find('nepenthes ampullaria')[0];

ampullaria.name // binomial name
ampullaria.domain
ampullaria.order
ampullaria.species

ampullaria.divisions // synonymous with Species.prototype.children
ampullaria.order.divisions

// using HAMT methods to determine parents and children
ampullaria.children
const nepenthes = tree.find('nepenthes')[0]
ampullaria.isParent(nepenthes);
// false
nepenthes.isParent(ampullaria);
// true

Phylogeny

const nepenthes
ampullaria.geneticDistance();

HAMT

Using HAMT means that we have an entire tree-searching algorithm at our hands. Let's use it to create a binomial name searching autocomplete.

Graphing

D3 is an optional dependency to try to keep this project footprint small, and because not everybody needs graphing. If you like other chart libraries, please feel free to let me know in the issues.

import d3 from 'd3';

Contributing

Issues and pull requests are very welcome!

Tests

yarn test

License

MIT