deno-init
deno-init copied to clipboard
Generate a Deno configuration file
dci
deno-config-init
(dci
) is a config file generator for Deno. It is loosely
modeled after tsc --init
and npm init
.
Table of Contents
- Installation
- Usage
- Options
- Contributing
Requirements
- Deno v1.17 is the bare minimum required to run this module, although Deno v1.24 is recommended in order to use all features.
Installation
deno install --allow-read --allow-write -fn dci https://deno.land/x/[email protected]/mod.ts
Usage
Make a config file based on a number of prompts:
dci
Skip the prompts, use all defaults:
dci --yes
Add every possible option in comments (as a .jsonc
file):
dci --fill
Options
--help
or -h
will print the CLI documentation to the terminal.
--yes
or -y
will skip the prompts and initialize the file in the current
working directory with default values:
dci --yes
--fill
or -i
will create a deno.jsonc
config file with all the possible
configuration options listed as comments. This style is very similar to the
output of tsc --init
for generating a tsconfig.json
.
dci --fill
It is also possible to add only specific fields to the config file and fill them with options in comments, for example:
dci --fmt --fill
--fmt
or -m
will add a fmt
section only.
dci --fmt
--lint
or -l
will add a lint
section only.
dci --lint
--map
or -p
will add an importMap
section only. Note that using
importMap
requires Deno 1.20 or higher.
dci --map
--task
or -k
will add a tasks
section only. Note that using tasks
requires Deno 1.20 or higher.
dci --task
--test
or -s
will add a test
section only. Note that using test
requires
Deno 1.24 or higher.
dci --test
--tsconfig
or -t
will add a compilerOptions
section only.
dci --tsconfig
It is possible to combine the fmt
, lint
, map
, task
and tsconfig
options.
--name
or -n
will use a non-default name for the config file. The default
name is deno.json
. Note that using a non-default name may prevent config file
auto-discovery.
dci --name config.json
--force
or -f
will allow overwriting an existing config file.
Contributing
You are welcome to report bugs, other issues, or make a feature request! If you want to add a fix/feature/other improvement, please fork this repository and make a pull request with your changes.