diff --git a/_build_npm.ts b/_build_npm.ts index 3f9b74f..48563eb 100755 --- a/_build_npm.ts +++ b/_build_npm.ts @@ -13,7 +13,14 @@ async function start() { await emptyDir("./npm"); await build({ - entryPoints: ["./mod.ts"], + entryPoints: [ + "./mod.ts", + { + kind: "bin", + name: "is-bun", + path: "./cli.ts", + }, + ], outDir: "./npm", shims: {}, test: false, diff --git a/cli.ts b/cli.ts new file mode 100644 index 0000000..ac214ab --- /dev/null +++ b/cli.ts @@ -0,0 +1,3 @@ +import { printIsBun } from "./mod.ts"; + +printIsBun(); diff --git a/mod.ts b/mod.ts index addf7ef..c8d4b0f 100644 --- a/mod.ts +++ b/mod.ts @@ -3,3 +3,11 @@ export function isBun(): boolean { // @ts-ignore return typeof Bun !== "undefined"; } + +export function printIsBun() { + if (isBun()) { + console.log("Buntime runtime!"); + } else { + console.log("It's not Bun, hun."); + } +}