🐻
Bearshell is a minimal package to help shell scripting in Node.js.
npm install bearshell
yarn add bearshell
pnpm add bearshell
Bearshell is inspired by the excellent zx. If you want a broad set of features, Bearshell isn't right for you. Fundamentally, Bearshell is a lightweight wrapper around child_process which enables syntax like
// Bearshell
$`echo hello world`;
// child_process
execSync("echo hello world");
// Bearshell
await $.async`echo hello world`;
// child_process
await new Promise((resolve, reject) =>
exec("echo hello world", (error, stdout, stderr) => {
if (error) {
throw error;
} else if (stderr) {
reject(stderr);
} else {
resolve(stdout);
}
})
);
Licensed under MIT.