esperance
v1.2.2
Published
Rust std utilities, now in JS/TS
Downloads
2
Readme
esperance
Rust std utilities, now in JS/TS
Installation
npm i esperance
Usage
import { Ok, Err } from 'esperance';
const ok = Ok(42);
if (ok.isOk()) {
console.log(ok.unwrap());
}
const err = Err('error');
if (err.isErr()) {
console.log('Err');
}
import { Some, None } from 'esperance';
const option = Some(42);
if (option.isSome()) {
console.log(option.unwrap());
}
const none = None;
if (none.isNone()) {
console.log('None');
}
License
This project is licensed under the MIT license.