diff --git a/README.md b/README.md index 9ad2d40..cea8a7b 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,16 @@ If you want to force [bun](https://bun.sh/), add: } ``` +If you want to force [deno](https://deno.land/), add: + +```json +{ + "scripts": { + "preinstall": "npx only-allow deno" + } +} +``` + ## License [MIT](LICENSE) diff --git a/__fixtures__/deno/package.json b/__fixtures__/deno/package.json new file mode 100644 index 0000000..74ff7ec --- /dev/null +++ b/__fixtures__/deno/package.json @@ -0,0 +1,5 @@ +{ + "scripts": { + "preinstall": "node ../../bin.js deno" + } +} \ No newline at end of file diff --git a/bin.js b/bin.js index 6273b26..49c51a0 100644 --- a/bin.js +++ b/bin.js @@ -1,6 +1,6 @@ #!/usr/bin/env node const whichPMRuns = require('which-pm-runs') -const availablePMList = ['npm', 'cnpm', 'pnpm', 'yarn', 'bun'] +const availablePMList = ['npm', 'cnpm', 'pnpm', 'yarn', 'bun', 'deno'] function box(s) { const lines = s.trim().split("\n") @@ -53,6 +53,12 @@ For more details, go to https://yarnpkg.com/`)) If you don't have Bun, go to https://bun.sh/docs/installation and find installation method that suits your environment.`)) break + + case 'deno': + console.log(box(`Use "deno install" for installation in this project. + +If you don't have Deno, go to https://deno.land/#installation and follow the installation instructions.`)) + break } process.exit(1) } diff --git a/package.json b/package.json index 50e0ae8..e510cf2 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,8 @@ "cnpm", "npm", "yarn", - "bun" + "bun", + "deno" ], "author": "Zoltan Kochan ", "license": "MIT",