chanid
v1.2.6
Published
CHANID (Chan Lay ID) - A compact and robust utility for generating unique identifiers in JavaScript and TypeScript.
Downloads
4
Maintainers
Readme
CHANID (Chan Lay ID)
CHANID is a minimalistic and efficient utility for generating unique identifiers in JavaScript and TypeScript. It can be seamlessly integrated into your projects, whether you're working with vanilla JavaScript or taking advantage of TypeScript's static typing.
Table of Contents
Installation
You can install CHANID via npm:
npm install chanid
Usage
CHANID is very easy to use. Simply import the module and call the function to generate a unique identifier.
// Import the CHANID function from the module
const chanid = require('chanid');
// Generate a unique identifier
const uniqueID = chanid();
console.log(uniqueID);
Note: If you are using TypeScript, you can use the import statement instead:
// Import the CHANID function from the module
import chanid from 'chanid';
// Generate a unique identifier
const uniqueID = chanid();
console.log(uniqueID);
Features
Generates unique identifiers based on the UUID format. Works in both JavaScript and TypeScript environments.
CDN Usage
You can also include CHANID directly in your HTML file using a CDN:
<!-- Latest version from jsDelivr (ECMAScript module) -->
<script type="module">
import chanid from 'https://cdn.jsdelivr.net/npm/[email protected]/dist/chanid.min.mjs';
const uniqueID = chanid();
console.log(uniqueID);
</script>
<!-- Latest version from jsDelivr (Minified script) -->
<script nomodule src="https://cdn.jsdelivr.net/npm/[email protected]/dist/chanid.min.js"></script>
Contributing
If you would like to contribute to CHANID, feel free to submit a pull request or open an issue.
License
This project is licensed under the ISC License - see the LICENSE.md
file for details.