# @playfusion/warhammer-deck-sharing

> Generate and parse deck sharing codes.

Latest version **1.0.15** (published 2018-11-05) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @playfusion/warhammer-deck-sharing
pnpm add @playfusion/warhammer-deck-sharing
yarn add @playfusion/warhammer-deck-sharing
bun add @playfusion/warhammer-deck-sharing
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.15 |
| Published | 2018-11-05 |
| First published | 2018-10-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 12.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Playfusion |
| Maintainers | murphybob |
| Keywords | warhammer, playfusion, tcg |

## Links

- npm: https://www.npmjs.com/package/@playfusion/warhammer-deck-sharing
- Repository: https://gitlab.com/playfusion-public/warhammer-deck-sharing-js
- Homepage: https://gitlab.com/playfusion-public/warhammer-deck-sharing-js#readme
- Issues: https://gitlab.com/playfusion-public/warhammer-deck-sharing-js/issues
- npm.io page: https://npm.io/package/@playfusion/warhammer-deck-sharing

## Recent versions

- 1.0.15 (latest) — 2018-11-05
- 1.0.14 — 2018-11-05
- 1.0.9 — 2018-10-29
- 1.0.8 — 2018-10-29
- 1.0.7 — 2018-10-29
- 1.0.6 — 2018-10-24
- 1.0.5 — 2018-10-24
- 1.0.4 — 2018-10-24
- 1.0.3 — 2018-10-24
- 1.0.2 — 2018-10-23
- 1.0.1 — 2018-10-23
- 1.0.0 — 2018-10-23

## README

# Warhammer Age of Sigmar: Champions Deck Sharing

Generate and parse deck sharing codes.

## Require

To require the module
    
    npm install --save @playfusion/warhammer-deck-sharing

Then import/require using your module loader of choice.

This module is compatible with NodeJS and browser environments.

#### Browserify example

    // main.js
    var deckSharing = require("@playfusion/warhammer-deck-sharing")
    deckSharing.generate([{id: 123, count: 1}, {id: 234, count: 2}])

then

    browserify main.js -o dist.js

## Generate deck codes

To create a deck code

```javascript
    import {generate} from "@playfusion/warhammer-deck-sharing"
    
    const deck = [
        {id: -276130957, count: 1},
        {id: -1050439153, count: 1},
        {id: -513512609, count: 2}
    ]
    generate(deck) // => _wEBD5JjwQJfa2ThAXOTiu8=
```

Using a generated deck code to link to the app

```html
    <a href="warhammer-tcg://share-deck?_wEBD5JjwQJfa2ThAXOTiu8=&amp;deepLinkTimestamp=1540311920029">Open in game</a>
```

## Parse deck codes

To parse a deck code

```javascript
    import {parse} from "@playfusion/warhammer-deck-sharing"
    
    const deck = parse("_wEBD5JjwQJfa2ThAXOTiu8=")
    // =>
    // [
    //  {id: -276130957, count: 1},
    //  {id: -1050439153, count: 1},
    //  {id: -513512609, count: 2}
    // ]
```

You can then use these ids against the card data API to get full card data.

## Bugs & Feedback

If you spot any issues or have any feedback, please get in touch via our
[official Discord channel](https://discord.gg/J59SZNN) using the #playfusion-feedback channel.

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