New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@advanced-rest-client/uuid-generator

Package Overview
Dependencies
Maintainers
4
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@advanced-rest-client/uuid-generator

An UUID generator as a web component

  • 3.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
415
decreased by-8.79%
Maintainers
4
Weekly downloads
 
Created
Source

uuid-generator

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

Published on NPM

Build Status

Published on webcomponents.org

Usage

Installation

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

As a module

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

In an html file (web component)

<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

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.

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

Development

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

Running the demo locally

npm start

Running the tests

npm test

Keywords

FAQs

Package last updated on 03 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc