Skip to content

ideafast/ideafast-idgen

Repository files navigation

Total alerts Language grade: JavaScript Mutation testing badge Build status Dependency Status devDependency Status

IDEAFast ID Generator

The IDEAFast ID Generation tool

Usage

Node.js

In a modern ES6 compatible setup you can simply import the @ideafast/idgen package (available from both NPM and GitHub).

$ yarn add @ideafast/idgen
import IDEAFastID from '@ideafast/idgen';

// Generate an ID
const id = IDEAFastID.generate();
// Validate an ID
if (IDEAFastID.validate(id))
    console.log(id);

Browser

To use the library directly within an HTML document you can reference or download it from a CDN such as unpkg.com

<html>
    ...
    <script src="https://unpkg.com/@ideafast/idgen@latest/dist/lib.umd.js"></script>
    <script>
        // Generate an ID
        const id = IDEAFastID.generate();
        // Validate an ID
        if (IDEAFastID.validate(id))
            document.body.innerText = id;
    </script>
    ...
</html>

Local development

Requirements

First things first, there's always something before you can start.

To make our life easier, we use Yarn a lot. Make sure you have it installed.

Build the library

Building the library is easy. First run yarn install && yarn run build, to build the application. Artifacts will be rendered in the /dist folder as the root of your clone.

Contributing

Pull requests are welcome! See the list of open issues to get an idea of what you could work on. Or, if you have an awesome idea, please create a new issue.