Tool library based on typscript
npm install @pengyin/tools



``sh
yarn add @pengyin/tools
Usage
`ts
import { to } from "@pengyin/tools";interface ServerResponse {
test: number;
}
const p = Promise.resolve({test: 123});
const [err, data] = await to(p);
async function asyncFunctionWithThrow() {
const [err, user] = await to(UserModel.findById(1));
if (!user) throw new Error('User not found');
}
``