Reputation: 52987
When I create an application on Node.js, I perform the following steps to publish it for other people:
main.js
file, which calls node:#!/usr/bin/env -S node --stack-size=10000
console.log("Hello world!")
package.json
: ...
"name": "my_app",
...
"bin": {
"my_app": "src/main.js"
},
...
npm publish
.And done: anyone can then now install it by typing npm i -g my_app
, and it will be made available to use on the terminal by typing my_app
. What are the equivalent steps to publish an application built using Deno instead?
Upvotes: 0
Views: 299
Reputation: 52987
Create an entry file (ex: main.ts
).
Host your project somewhere.
Install it anywhere using the URL to main.ts
:
deno install -n your_app https://your_url/your_app/main.ts
You can pass Deno options in the same way you would for deno run
:
deno --unstable install -n your_app --allow-all URL_HERE
If you have a Github repository, you can get a URL to your file by browsing to it, and clicking on "Raw". It will be something like:
https://raw.githubusercontent.com/your_org/your_app/tree/master/main.ts
This URL can be used to install your app.
You can also register a Github repository on https://deno.land/x
. This will give you a shorter url:
https://deno.land/x/your_app/main.ts
As well as a way to keep track of immutable versions:
https://deno.land/x/your_app@version/main.ts
Thanks for the devs on Deno's Discord for the help.
Upvotes: 3
Reputation: 2009
Since deno uses urls for dependencies you do not need to publish anything from your cli. You can simply host it as a public repo on github. Then you can add it to their third-party library here by clicking on the 'publish a module' button
Upvotes: 1