@tgwf/greentrace-cli

0.2.0 • Public • Published

Greentrace lib

The standalone library used by the GreenTrace App to show

  • where packets are hoping through the world when you make a request from your machine, based on the Geolite IP Database

  • which hops pass through infrastructure running on green energy, as listed by the Green Web Foundation

Usage

As a command line tool

This will run a traceroute, then print to STDOUT a GeoJSON file with coordinates for every IP address, as looked up in the GeoIP database.

npx greentrace --domain=yourdomain.com

Note: it's not fast. I'd welcome pointers on making this run faster, without losing too much info.

As a library

You can also run this as a library in a larger application. You can see this in use in the greentrace electron app, designed plot these hops on a map.

import GreenTrace from "@tgwf/greentrace-lib"

// return a Promise, that resolves to an array
const hops = await GreenTrace.trace(domainName)

// make this into something we can put on a map
const hopsAsgeoJSON = hops.toGeoJSON()

Licenses

There are two licenses, for the code and data. See the LICENSE file for details.

Package Sidebar

Install

npm i @tgwf/greentrace-cli

Weekly Downloads

1

Version

0.2.0

License

Apache-2.0

Unpacked Size

22.8 kB

Total Files

12

Last publish

Collaborators

  • fershad
  • mrchrisadams
  • franka