Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pelias-compare

Package Overview
Dependencies
Maintainers
2
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pelias-compare

Pelias geocoder frontend comparison and debugging tool

  • 0.1.22
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
81
decreased by-1.22%
Maintainers
2
Weekly downloads
 
Created
Source

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

FAQs

Package last updated on 29 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc