prcall
v0.0.5
Published
<div align="center"> <h1>prcall</h1> <p>Lua's pcall ported to Javascript</p> </div>
Downloads
3
Readme
How to use?
First, install the prcall package using:
npm install prcallExample code:
import * as pr from "prcall"
function risky(str: string) {
throw new Error(str);
}
// safely call using pr.pcallSync
const response = pr.pcallSync(risky, "Hello!");
if (response.error) {
console.error("an error occured!");
console.error("error: " + response.error);
}
// result: response.resultCredits
Made with <3 by Rui Reogo
