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

pelias-compare

v0.1.22

Published

Pelias geocoder frontend comparison and debugging tool

Downloads

1,001

Readme

compare

A tool for interactively debugging pelias api queries.

This tool has three modes, a standalone mode, standalone SPA and an api/bundled mode. They share 99.9% of code and really only differ in their code entry points that specify some booleans to configure them.

Standalone mode

Build: yarn build Local dev hot-reload server: yarn serve Local dev hot-reload https server (required for geolocation): yarn serve-https

The standalone mode is what is hosted on https://pelias.github.io/compare/ - it defaults to geocoding against two geocode.earth api servers if other hosts aren't specified. It puts query params in location.hash of the url.

Standalone SPA mode

Built by yarn build:spa

For now, this is hosted at https://pelias-compare.firebaseapp.com/. The only real difference is that this uses Single Page App (SPA) style routing, where every url is redirected to index.html, and query parameters are updated in location.search. The idea is that this could be hosted at compare.geocode.earth, so if you're debugging an http query at api.geocode.earth/xxxx you can just change the first part of the url to "compare" to get the gaphical experience.

API/bundled mode

The api/bundled mode is what is in-lined into the pelias api server. It defaults to geocoding against the host which it is served from.

The compiled output of the api/bundled version is published as a dependency free npm package called (pelias-compare)[https://www.npmjs.com/package/pelias-compare] - the api server takes this on as a dependency so it can serve the frontend on the server without needing any of the web frontend dependencies in its build chain.

As a result, please only add new deps with yarn add --dev or npm install --save-dev

Project setup

yarn install

Compiles and hot-reloads for development

yarn serve

This will print out a message telling you what port it's running on locally. Generally http://localhost:8080

Compiles and minifies for standalone production

yarn build

Compiled artifacts will be output to docs/ (so that this could be hosted on github pages easily)

Compiles and minifies for api production

yarn build:api

Compiled artifacts will be output to dist-api/

Compiles and minifies for SPA

yarn build:spa

Compiled artifacts will be output to spa/

Publish a new version to npmjs

yarn publish