@shrimpcoder/ts-result
v0.1.3
Published
A TypeScript-based Result library
Downloads
280
Readme
TS Result
This library is a TypeScript library inspired by Rust's Result
type, designed to represent the success or failure of an operation. It provides two classes, Ok
and Err
, to handle the results of operations concisely.
Installation
npm install @shrimpcoder/ts-result
Usage
import { Result } from '@shrimpcoder/ts-result';
const result = Result.run(() => {
return 100;
});
console.log(result.unwrap());
For more details, see here.
License
This project is licensed under the MIT License.