Skip to content

GJZwiers/deno-config-init

Repository files navigation

dci

Deprecated - this module is no longer actively maintained.

deno module deno compatibility Build Coverage Status Deno

deno-config-init (dci) is a config file generator for Deno. It is loosely modeled after npm init and tsc --init.

Table of Contents

Requirements

  • Deno v1.30 or higher

Installation

deno install --allow-read --allow-write -fn dci https://deno.land/x/dci@v2.8.1/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

--lock or -o will add the lock field as a boolean. Note that using lock requires Deno 1.29 or higher.

dci --test

--lockfile or -i will add the lock field as a string.

dci --lockfile

--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.

Most options can be combined, e.g. dci --fmt --lint.

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.