Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

command line tool proposal #1702

Closed
axetroy opened this issue Feb 7, 2019 · 6 comments
Closed

command line tool proposal #1702

axetroy opened this issue Feb 7, 2019 · 6 comments

Comments

@axetroy
Copy link
Contributor

axetroy commented Feb 7, 2019

something like npm install xxx -g

we need to write a command line tool for deno to do something job. eg. pm2

Like npm, there is a bin directory that place the syslink of the executable file. eg. .deno/bin

Design goals:

Since deno does not have package.json, we don't know which file is executable.

So we set a rule: Executable files are only stored in the bin directory

deno install xxx

# download pm2
deno install https://deno.land/x/pm2
# download completed
# then find all executable files in https://deno.land/x/pm2/bin/ directory
# add link to the ``.deno/bin`` directory
pm2 --help # https://deno.land/x/pm2/bin/pm2.ts
pm2-runtime --help # https://deno.land/x/pm2/bin/pm2-runtime.ts

denox

or like npx pm2
or make be it can be third-party library

# download in a temp directory and run
denox https://deno.land/x/pm2/pm2
# when process exit. remove the dependence file
@bartlomieju
Copy link
Member

So we set a rule: Executable files are only stored in the bin directory

This introduces another "rule" which is somewhat magical. Right now the same effect can be achieved using simple bash aliases:

alias pm2='deno https://deno.land/x/pm2'

@ry
Copy link
Member

ry commented Jun 7, 2019

discussion moved here denoland/std#471

@ry ry closed this as completed Jun 7, 2019
@runnerSnail
Copy link

I tried but deno https://deno.land/x/pm2 not found. I want to deploy deno project by pm2, and deno can't provide pm2 modules.

@OnlyFlyer
Copy link

I tried but deno https://deno.land/x/pm2 not found. I want to deploy deno project by pm2, and deno can't provide pm2 modules.

I have too

@axetroy
Copy link
Contributor Author

axetroy commented Jun 16, 2019

@runnerSnail it just an example.

Deno does not have this module

@OnlyFlyer
Copy link

@runnerSnail it just an example.

Deno does not have this module

How did you solve it? @axetroy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants