Migrate to typescript and enhance dx
Release Notes for random-string v2.0 π
We're excited to announce the release of randomString v2.0! π This version includes some significant updates and optimizations that make generating random strings easier and more efficient. Here's what's new:
π¨ Enhanced API
- The function now accepts an object with
lengthandallowedCharactersas properties to make the API clearer and more flexible. π
// Old way (v1.0)
randomString(10, 'abc123');
// New way (v2.0)
randomString({ length: 10, allowedCharacters: 'abc123' });π οΈ Improved Performance
- We've optimized the string generation process, making it faster and more memory-efficient. β‘
π¦ Module Import Update
- For CommonJS users, make sure to append
.defaultwhen requiring the module:
const randomString = require('@smakss/random-string').default;π Simplified Usage
- With default parameters, you can easily generate a random string without specifying any arguments:
randomString();𧬠Default Length Randomization
- If
lengthisn't provided, it will now be randomly selected between 1 and 20 to give you a varied and unpredictable string length. π²
π Updated Documentation
- The README has been updated to reflect all these changes, making it easier for you to integrate
randomStringinto your projects. π
π Contribution and Conduct
- As always, we welcome contributions. Check out CONTRIBUTING.md for how to get started. π€
- We've committed to making this project welcoming and inclusive to all. Our Code of Conduct outlines our expectations for participant behavior. π€
We appreciate your support and feedback on this new release. Give it a try and let us know what you think! π’