# @advanced-rest-client/uuid-generator

> An UUID generator as a web component

Latest version **3.1.2** (published 2021-03-03) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @advanced-rest-client/uuid-generator
pnpm add @advanced-rest-client/uuid-generator
yarn add @advanced-rest-client/uuid-generator
bun add @advanced-rest-client/uuid-generator
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.1.2 |
| Published | 2021-03-03 |
| First published | 2019-02-20 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 34.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | carowright, jarrodek, twoplustwoone, lbauret |
| Keywords | web-components, uuid, generator |

## Links

- npm: https://www.npmjs.com/package/@advanced-rest-client/uuid-generator
- Repository: https://github.com/advanced-rest-client/uuid-generator
- Homepage: https://github.com/advanced-rest-client/uuid-generator#readme
- Issues: https://github.com/advanced-rest-client/uuid-generator/issues
- npm.io page: https://npm.io/package/@advanced-rest-client/uuid-generator

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 3.1.2 (latest) — 2021-03-03
- 3.1.1 — 2020-10-21
- 3.1.0 — 2020-05-20
- 3.0.2 — 2019-09-11
- 3.0.1 — 2019-06-05
- 3.0.0 — 2019-06-02
- 3.0.0-preview.3 — 2019-06-01
- 3.0.0-preview.2 — 2019-04-04
- 3.0.0-preview.1 — 2019-02-20

## README

# uuid-generator

An UUID v4 generator as a plain web component and an ES module. Made for a web browser.

[![Published on NPM](https://img.shields.io/npm/v/@advanced-rest-client/uuid-generator.svg)](https://www.npmjs.com/package/@advanced-rest-client/uuid-generator)

[![Build Status](https://travis-ci.com/advanced-rest-client/uuid-generator.svg)](https://travis-ci.com/advanced-rest-client/uuid-generator)

[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/advanced-rest-client/uuid-generator)

## Usage

### Installation

```sh
npm install --save @advanced-rest-client/uuid-generator
```

### As a module

```javascript
  import { v4 } from '@advanced-rest-client/uuid-generator';
  console.log(v4());
```

### In an html file (web component)

```html
<html>
  <head>
    <script type="module">
      import '@advanced-rest-client/uuid-generator';
    </script>
  </head>
  <body>
    <uuid-generator id="uuid"></uuid-generator>
    <script>
    console.log(uuid.generate());
    </script>
  </body>
</html>
```

### In a LitElement

```js
import { LitElement, html } from 'lit-element';
import { v4 } from '@advanced-rest-client/uuid-generator';

class SampleElement extends LitElement {
  render() {
    return html`my component`;
  }

  _someOperation() {
    const uuid = v4();
  }
}
customElements.define('sample-element', SampleElement);
```

### Browser or a web worker

For historic reasons the `index.js` file contains an export for both the `v4` function but also the web component. When using this module in a web worker or in Node this would cause an error.
Instead import the module with the `main.js` file. For compatibility this file is not set as the `module` in the `package.json` file.

```javascript
import { v4 } from '@advanced-rest-client/uuid-generator/main.js';
```

## Development

```sh
git clone https://github.com/advanced-rest-client/uuid-generator
cd uuid-generator
npm install
```

### Running the demo locally

```sh
npm start
```

### Running the tests

```sh
npm test
```

---
_Source: https://npm.io/package/@advanced-rest-client/uuid-generator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
