# @abeai/node-short-url

> node.js URL shortener

Latest version **1.1.0** (published 2022-02-02) · 0 weekly downloads

## Install

```sh
npm install @abeai/node-short-url
pnpm add @abeai/node-short-url
yarn add @abeai/node-short-url
bun add @abeai/node-short-url
```

## 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.1.0 |
| Published | 2022-02-02 |
| First published | 2019-03-21 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 13.3 KB |
| Known vulnerabilities | 0 (+8 in 2 direct dependencies) |
| Install scripts | no |
| Author | Abe.ai |
| Maintainers | abe-ai, abeai-sam |

## Links

- npm: https://www.npmjs.com/package/@abeai/node-short-url
- Repository: https://github.com/abeai/node-short-url
- Homepage: https://github.com/abeai/node-short-url#readme
- Issues: https://github.com/abeai/node-short-url/issues
- npm.io page: https://npm.io/package/@abeai/node-short-url

## Dependencies (4)

- [lodash](https://npm.io/package/lodash.md) 4.17.11
- [request](https://npm.io/package/request.md) 2.88.0
- [@abeai/autoloader](https://npm.io/package/@abeai/autoloader.md) ^2.1.3
- [request-promise-native](https://npm.io/package/request-promise-native.md) 1.0.7

## Recent versions

- 1.1.0 (latest) — 2022-02-02
- 1.0.0 — 2019-03-21

## README

# node-short-url

URL shortener for usage with node.js applications. Supports multiple backends.

## Interface

### `Promise shorten(url[, opts])`

Shorten a URL using the requested backend.

#### opts

- backendType `String`
	- Provide a backend type to use or override `process.env.NODE_SHORT_URL_BACKEND`.

- backendOptions `Object`
	- Backend specific options to use for short url generation.

## Environment Variables

- NODE_SHORT_URL_BACKEND
	- Define the short url backend to use. Can override with `opts.backendType`.

## Backends

### Firebase

https://firebase.google.com/docs/reference/dynamic-links/link-shortener

Create dynamic links via Firebase's API. Options are provided in the `dynamicLinkInfo` JSON format.

#### Default Options

- suffix.option
	- Defaults to `SHORT`.

#### Required Environment Variables

- NODE_SHORT_URL_FIREBASE_DOMAIN
- NODE_SHORT_URL_FIREBASE_API_KEY
	- Can pass `backendOptions.key` to override.

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