Repository navigation
Releases: devharshthakur/trycatch-lib
Release list
v0.1.0-alpha.3.0
📝 Release Notes
✅ What’s New
- Added Tests
Comprehensive tests have been introduced to ensure code reliability and stability.
❌ Removed
makeAsyncUtility- The
makeAsyncfunctionality/feature has been completely removed from the package, simplifying the codebase.
- The
🛠️ Improvements
- Refined Documentation
Documentation has been updated and improved for better clarity and usability. Docs folder is be removed, instead readme acts as docs
v0.1.0-alpha.2.1
trycatch-lib: v0.1.0-alpha.2.1
🚀 Alpha Release: Incremental Updates 🧪
This release encompasses changes introduced subsequent to the initial v0.1.0-alpha.0 release, culminating in version v0.1.0-alpha.2.1.
This remains an alpha version intended for evaluation and feedback. The API is subject to modification, and its utilization in production environments is not recommended.
✨ Key Enhancements Since v0.1.0-alpha.0
-
Version Control: The package version has been incremented to
0.1.0-alpha.2.1to reflect internal modifications and refinements. -
Documentation Augmentation: The
README.mdfile has undergone significant enhancement, incorporating comprehensive examples for improved clarity and usability:- Elucidated examples demonstrating the application of
trycatchwith both asynchronous (fetch) and synchronous (JSON.parse) functions. - Detailed examples illustrating the usage of the
makeAsyncutility and the requisite handling of theMakeAsyncErrorreturn type. - Expanded API reference section within the
README.md, providing comprehensive specifications and type signatures formakeAsyncandMakeAsyncError, alongside coretrycatchcomponents.
- Elucidated examples demonstrating the application of
-
makeAsyncUtility:- The
makeAsyncutility and its associatedMakeAsyncErrorare now patched with new code to make it work as intended and explicitly documented and presented as an integral part of the library's API. ⚠️ Caveat: Attention is drawn to the inherent limitations in the reliability of the runtime check employed bymakeAsyncfor detecting pre-existing asynchronous function characteristics. This mechanism may exhibit inaccuracies within bundled or transpiled code contexts. Exercise caution during implementation.
import { makeAsync, MakeAsyncError } from "trycatch-lib"; function synchronousFunction(x: number): number { // Executes a synchronous operation return x * 2; } const newAsyncFunc = makeAsync(synchronousFunction); if (potentiallyAsyncFunc instanceof MakeAsyncError) { console.error("Failed to wrap:", potentiallyAsyncFunc.message); } else { (async () => { // Invokes the asynchronously adapted function const result = await potentiallyAsyncFunc(10); console.log(result); // Output: 20 })(); }
- The
⬇️ Installation (Latest Alpha Release)
To evaluate the latest alpha version (v0.1.0-alpha.2.1 or via the @alpha tag):
# Using pnpm
pnpm add trycatch-lib@alpha
# Using npm
npm install trycatch-lib@alpha
# Using yarn
yarn add trycatch-lib@alpha🛠️ Usage Guidelines
Refer to the README.md file for comprehensive usage examples and detailed API documentation.
📢 Feedback Solicitation
Your insights and feedback regarding these alpha versions are highly valued. Please report any identified issues or suggested enhancements via the GitHub repository. Your contributions are greatly appreciated.
Full Changelog: 0.1.0-alpha.0...0.1.0-alpha2.1
0.1.0-aplha.0
🚀 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. 📚