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);
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>
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.
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.
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.