# @thumbsmith/url

> Small utility to help with constructing thumbsmith thumbnail URLs

Latest version **0.1.3** (published 2022-09-27) · ISC license · 0 weekly downloads

## Install

```sh
npm install @thumbsmith/url
pnpm add @thumbsmith/url
yarn add @thumbsmith/url
bun add @thumbsmith/url
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2022-09-27 |
| First published | 2022-01-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Alexandre Lotte |
| Maintainers | loteoo |

## Links

- npm: https://www.npmjs.com/package/@thumbsmith/url
- npm.io page: https://npm.io/package/@thumbsmith/url

## Dependencies (1)

- [qs](https://npm.io/package/qs.md) ^6.10.2

## Recent versions

- 0.1.3 (latest) — 2022-09-27
- 0.1.2 — 2022-03-23
- 0.1.1 — 2022-01-13
- 0.1.0 — 2022-01-07

## README

# @thumbsmith/url

Small utility to help with constructing thumbsmith thumbnail URLs

<div class="hide-in-docs">
  Read more at http://thumbsmith.com/
</div>

## Installation

```bash
npm install @thumbsmith/url
```

## Usage

```js
import getImageUrl from "@thumbsmith/url";

const imageUrl = getImageUrl({
  account: "my-account-name",
  template: "product",
  type: "png", // Optional
  data: {
    title: "Hello world!",
    breadcrumb: ["Products", "Sports", "Bikes"],
    price: 49.99,
  },
});

console.log(imageUrl);
// Result:
// https://cdn.thumbsmith.com/v1/u/my-user-name/product.png?title=Hello%20world%21&breadcrumb%5B0%5D=Products&breadcrumb%5B1%5D=Sports&breadcrumb%5B2%5D=Bikes&price=49.99
```

#### Typescript
```ts
import getImageUrl from "@thumbsmith/url";

interface ImageProps {
  title: string;
  breadcrumb: string[];
  price: number;
}

const imageUrl = getImageUrl<ImageProps>({
  account: "my-account-name",
  template: "product",
  type: "png", // Optional
  data: {
    title: "Hello world!",
    breadcrumb: ["Products", "Sports", "Bikes"],
    price: 49.99,

    // This line will cause an error
    foo: "bar",
  },
});
```

See the <a href="https://thumbsmith.com/docs/use-a-template">use a template</a> page for more info.

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