Skip to content

0.1.0-aplha.0

Pre-release
Pre-release

Choose a tag to compare

@devharshthakur devharshthakur released this 26 Mar 16:37
· 12 commits to main since this 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@alpha

Using npm:

npm install trycatch-lib@alpha

Using 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.
  • 🔥 TryCatchError class: 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 a TryCatchError instance.
  • 🔗 TryCatchResultTuple<T> type: A type alias representing the consistent [error, result] tuple format.
  • 🚫 Eliminates try...catch boilerplate: 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 exports field in package.json offers 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.com token. 🔑
  • The package.json may contain local file paths (link: dependencies) and should be replaced before publishing to npmjs.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. 📚