Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
5 changes: 5 additions & 0 deletions __fixtures__/deno/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"scripts": {
"preinstall": "node ../../bin.js deno"
}
}
8 changes: 7 additions & 1 deletion bin.js
Original file line number Diff line number Diff line change
@@ -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")
Expand Down Expand Up @@ -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)
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"cnpm",
"npm",
"yarn",
"bun"
"bun",
"deno"
],
"author": "Zoltan Kochan <[email protected]>",
"license": "MIT",
Expand Down