# @arcblock/did-motif

> A javascript library for generating [DID](https://github.com/ArcBlock/ABT-DID-Protocol) identicons.

Latest version **1.1.14** (published 2025-07-04) · 0 weekly downloads

## Install

```sh
npm install @arcblock/did-motif
pnpm add @arcblock/did-motif
yarn add @arcblock/did-motif
bun add @arcblock/did-motif
```

## Health

**Score 30/100 (F)** — status: maintenance-mode.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.14 |
| Published | 2025-07-04 |
| First published | 2022-02-22 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 40.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | wangshijun, polunzh, mave99a, gxw |

## Links

- npm: https://www.npmjs.com/package/@arcblock/did-motif
- npm.io page: https://npm.io/package/@arcblock/did-motif

## Dependencies (1)

- [bs58](https://npm.io/package/bs58.md) ^5.0.0

## Recent versions

- 1.1.14 (latest) — 2025-07-04
- 1.1.13 — 2023-07-06
- 1.1.12 — 2023-06-18
- 1.1.11 — 2023-06-14
- 1.1.10 — 2022-06-09
- 1.1.9 — 2022-05-31
- 1.1.8 — 2022-05-27
- 1.1.7 — 2022-05-24
- 1.1.6 — 2022-05-24
- 1.1.5 — 2022-04-12
- 1.1.4 — 2022-04-07
- 1.1.3 — 2022-03-23
- 1.1.2 — 2022-03-17
- 1.1.1 — 2022-03-03
- 1.1.0 — 2022-03-03
- … 6 more at https://npm.io/package/@arcblock/did-motif/versions

## README

# DID Motif

A javascript library for generating [DID](https://github.com/ArcBlock/ABT-DID-Protocol) identicons.

## Installation

```bash
npm i @arcblock/did-motif
# Or Yarn
yarn add @arcblock/did-motif
```

## Usage

render DID Motif: 

``` js
import { update } from '@arcblock/did-motif';

const element = document.getElementById('my-canvas');
// or const element = document.getElementById('my-svg');
update(element, 'z35n6X6rDp8rWWCGSiXZgvd42bixdLULmX8oX', { size: 36 });
```

render DID Motif with animation: 

``` js
import { update } from '@arcblock/did-motif';

const element = document.getElementById('my-canvas');
// or const element = document.getElementById('my-svg');
update(element, 'z35n6X6rDp8rWWCGSiXZgvd42bixdLULmX8oX', { size: 36, animation: true });
```


use `toDataURL` to convert a DID to an image data URL, we can assign the `DataURL` as the value of the `src` attribute of `<img>` element.

``` js
import { toDataURL } from '@arcblock/did-motif';

const img = document.getElementById('my-img');
img.src = toDataURL({ did: 'z35n6X6rDp8rWWCGSiXZgvd42bixdLULmX8oX', size: 36 });
```

See more examples and options of working with `@arcblock/did-motif` [here](https://github.com/ArcBlock/did-motif/blob/master/examples/index.js).

## License

Copyright 2018-2022 ArcBlock

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

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