bun-safe
Version:
Run scripts using Bun.js and perhaps install Bun first if necessary.
38 lines (26 loc) • 544 B
Markdown
> Run scripts using Bun.js and perhaps install Bun first if necessary.
```ts
import { bunSafe } from 'bun-safe';
bunSafe('--version') // -> string;
```
Options and results:
```ts
type Options = {
encoding?: 'utf8' | 'buffer';
stdio?: 'overlapped' | 'pipe' | 'ignore' | 'inherit';
};
type DefaultOptions = { encoding: 'utf8'; stdio: 'inherit' };
type Result = string | Buffer;
```
After globally installed
```shell
bun-safe --version
```
```shell
pnpm i -g bun-safe
```
MIT