- v2.6.1Latest
- v2.6.0
- v2.5.6
- v2.5.5
- v2.5.4
- v2.5.3
- v2.5.2
- v2.5.1
- v2.5.0
- v2.4.4
- v2.4.3
- v2.4.2
- v2.4.1
- v2.4.0
- v2.3.1
- v2.3.0
- v2.2.0
- v2.1.1
- v2.1.0
- v2.0.1
- v2.0.0
- v1.5.3
- v1.5.2
- v1.5.1
- v1.5.0
- v1.4.0
- v1.3.0
- v1.2.0
- v1.1.2
- 1.1.1
- 1.1.0
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 0.16.2
- 0.16.1
- 0.16.0
- 0.15.7
- 0.15.6
- 0.15.5
- 0.15.4
- 0.15.3
- 0.15.2
- 0.15.1
- 0.15.0
- 0.14.0
- 0.13.1
- 0.13.0
- 0.12.2
- 0.12.1
- 0.12.0
- 0.11.1
- 0.10.1
- 0.10.0
- 0.9.2
- 0.9.1
- 0.9.0
- 0.8.1
- 0.8.0
- 0.7.0
- 0.6.0
- 0.5.3
- 0.5.2
- 0.5.1
- 0.5.0
- 0.4.0
- 0.3.0
- 0.2.2
- 0.2.1
- 0.2.0
- 0.1.3
init
deno-init
is a simple command line tool to initialize a new Deno project
from a template or through a series of prompts.
Please note this module’s API is not stable yet and there may be breaking changes on
0.x
version increments.
Requirements
deno
installed and available on a terminal.
Installation
Use deno install
to install the executable. It is recommended to specify a
version number in the URL: if no version is passed the latest will be installed.
To upgrade an existing installation include -f
.
deno.land
deno install --allow-read --allow-run --allow-write --unstable -n deno-init https://deno.land/x/init@0.14.0/mod.ts
nest.land
deno install --allow-read --allow-run --allow-write --unstable -n deno-init https://x.nest.land/init@0.14.0/mod.ts
github
deno install --allow-read --allow-run --allow-write --unstable -n deno-init https://raw.githubusercontent.com/GJZwiers/deno-init/main/mod.ts
Permissions
The program needs the following permissions to run:
read
: to load files that are used to initialize projects from templatesrun
: to rungit init
if the git option is truewrite
: to make files in order to initialize new projectsunstable
: to allow the use of unstable APIs. These mostly originate in the module’s dependencies.
Basic Usage
deno-init
This will prompt you for the following:
- TypeScript? (default
y
) - Entrypoint? (default
mod.ts
) - Dependency entrypoint? (default
deps.ts
) - Debug configuration? (default
n
).
Choosing all defaults will create the following structure in the current
directory and run git init
:
.
│ .gitignore
│ deps.ts
│ mod.ts
│
└───.vscode
│ │ launch.json
│ │ settings.json
.gitignore
will ignore .vscode/
and settings.json
will contain
"deno.enable": "true"
. If debug is answered with y/Y
a launch.json
will be
made with a basic debug configuration.
Available Options
Use --help
to print all available options. In addition, they are listed below:
Use --yes
or -y
if you simply want to use all the default values without
being prompted:
deno-init -y
Use --cache
or -c
to cache dependencies in e.g. deps.ts
after all the files have been made.
deno-init --cache
deno-init
will not overwrite files or directories unless --force
is passed.
Use --editor
or -e
to generate editor-specific configuration for a project.
At this moment only the option vscode
is supported and it is also set as the
default.
deno-init --editor vscode
Use --force
or -f
in case you explicitly want to overwrite existing files.
This can be helpful to re-initialize but use with caution.
deno-init -f
Use --name
or -n
to make a new directory in the current directory where the
files will be placed.
deno-init --name my_deno_project
Use --no-git
if you don’t want to run git init
as part of initializing the
project.
deno-init --no-git
Subcommands
Use --help
to get more detailed information on any of the subcommands. The
--template
or -t
option can be used with any subcommand in addition to the
other options to select a project template. If no template is passed the program
will prompt you with a list of choices.
api
Use to initialize a Deno RESTful API from a template.
deno-init api --template opine
Available templates: opine
, restful_oak
.
cli
Use to initialize a Deno Command Line Interface (CLI) from a template.
deno-init cli --template cliffy
Available templates: cliffy
.
server
Use to initialize a Deno HTTP server from a template.
deno-init server --template oak
Available templates: deno_http
, drash
, oak
.
tdd
Use to initialize a Deno Test-Driven Development project from a template.
deno-init tdd --template rhum
Available templates: deno
, rhum
.
Roadmap
- Support more editor/IDE setups
- Add more project templates