# tude

> Encodes and decodes latitude and longitude so that it can be used in URLs that need to be as short as possible.

Latest version **1.0.0** (published 2015-10-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install tude
pnpm add tude
yarn add tude
bun add tude
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2015-10-17 |
| First published | 2015-10-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Eric Dorsey |
| Maintainers | edorsey |
| Keywords | Latitude, Longitude, Base62, URL |

## Links

- npm: https://www.npmjs.com/package/tude
- Repository: https://github.com/edorsey/tude
- Issues: https://github.com/edorsey/tude/issues
- npm.io page: https://npm.io/package/tude

## Dependencies (1)

- [base62](https://npm.io/package/base62.md) ^1.1.0

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2015-10-17

## README

# Tude

This is a simple module that allows you to encode and decode latitude and longitude coordinates for use in URLs while keeping the space the information occupies to a minimum. This is useful if you are wanting to pass GPS coordinates in a URL and keep the link as short as possible (for example, SMS or Twitter).

## API

### encode(lat, lng, [precision=6])

```js
var tude = require('tude');

tude.encode(39.092765, -94.584045); //62E1Ot-6oRD7
```

The first character represents the precision of the encoding. This is basically how many decimal places to keep intact. A smaller precision will result in a shorter string. `precision` defaults to `6`.

### decode(encodedLatLng)

```js
var tude = require('tude');

tude.decode("62E1Ot-6oRD7"); //{ lat: 39.092765, lng: -94.584045 }
```

---
_Source: https://npm.io/package/tude · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
