unique-transaction-id
v1.0.2
Published
A package to generate unique transaction IDs using UUID and timestamp-based methods.
Downloads
17
Maintainers
Readme
unique-transaction-id
A Node.js package to generate unique transaction IDs using UUID and timestamp-based methods.
Installation
To install the package, use npm:
bash npm install unique-transaction-id
Usage
After installing, you can use the package in both JavaScript and TypeScript projects.
JavaScript
const { generateUUIDTransactionId, generateTimestampTransactionId } = require('unique-transaction-id');
console.log('Generated UUID Transaction ID:', generateUUIDTransactionId()); console.log('Generated Timestamp Transaction ID:', generateTimestampTransactionId());
TypeScript
import { generateUUIDTransactionId, generateTimestampTransactionId } from 'unique-transaction-id';
console.log('Generated UUID Transaction ID:', generateUUIDTransactionId()); console.log('Generated Timestamp Transaction ID:', generateTimestampTransactionId());
API
generateUUIDTransactionId() Generates a UUID (version 4) transaction ID.
Returns: string - A UUID transaction ID.
generateTimestampTransactionId() Generates a timestamp-based transaction ID.
Returns: string - A timestamp-based transaction ID.
License
This package is licensed under the MIT License.
Author
rstarkumawat
Changelog
1.0.2