Repository navigation
0.1.0-aplha.0
Pre-release🚀 Release Preview: trycatch-lib v0.1.0-alpha.0 🧪
🚨 THIS IS AN ALPHA RELEASE INTENDED FOR EARLY TESTING AND FEEDBACK. NOT FOR PRODUCTION USE! 🚨
This document highlights the changes in the initial v0.1.0 alpha release of trycatch-lib, now available for early preview under the @alpha distribution tag on npm.
We encourage adventurous developers to test this version on simple typescript projects and provide feedback on the core functionality. 🛠️
⬇️ Installation
To install this specific preview version, use the @alpha tag with your package manager:
Using pnpm:
pnpm add trycatch-lib@alphaUsing npm:
npm install trycatch-lib@alphaUsing yarn:
yarn add trycatch-lib@alpha(Replace @alpha with the actual tag used for publishing if you choose a different one.)
✨ Highlights & Changes in this Preview (v0.1.0-alpha.0)
This is the first alpha release of trycatch-lib. It lays the foundation for a try...catch-less error handling experience. 🚀 Key features include:
- 📦
trycatch(fn)function: Wraps any function (sync or async) and returns a new function that always resolves to a[error, result]tuple. - 🔥
TryCatchErrorclass: A custom error class for encapsulating the original error or thrown value, providing context and traceability. - ✅
isTryCatchError(error: unknown)function: A TypeScript type guard to safely determine if a value is aTryCatchErrorinstance. - 🔗
TryCatchResultTuple<T>type: A type alias representing the consistent[error, result]tuple format. - 🚫 Eliminates
try...catchboilerplate: Simplifies asynchronous JavaScript/TypeScript code by centralizing error handling into a predictable pattern. - ⚙️ Leverages modern module systems: Exports CommonJS and ES Module formats for wide compatibility. The
exportsfield inpackage.jsonoffers import flexibility.
⚠️ Known Issues
- This is an early alpha release - expect API changes based on feedback. 🚧
- Testing coverage is still limited at this stage. 🧪
- Documentation is in progress. 📝
- Users must test against and with a valid
npmjs.comtoken. 🔑 - The
package.jsonmay contain local file paths (link:dependencies) and should be replaced before publishing tonpmjs.com.⚠️
📢 Providing Feedback
Your feedback is super valuable to me! 💖 Please report any bugs, unexpected behavior, or suggestions by opening an issue on our GitHub repository:
https://github.com/yourusername/trycatch-lib/issues
When reporting issues, please include:
- The preview version you are using (
v0.1.0-alpha.0). - Your Node.js version and operating system.
- Clear steps to reproduce the issue.
- Any relevant code snippets.
🛑 Disclaimer
This alpha release is potentially unstable and may contain bugs. Features and APIs might change significantly before the final stable release. DO NOT USE THIS VERSION IN PRODUCTION ENVIRONMENTS. 🛑
🙏 Thank you for helping me build & test trycatch-lib! For documentation on the latest stable release (when it exists), please see the main README.md. 📚