https://github.com/gjzwiers/mod
Simple Command Line Interface to create Deno module entrypoints, CI, config and more.
https://github.com/gjzwiers/mod
cli deno javascript typescript
Last synced: 2 months ago
JSON representation
Simple Command Line Interface to create Deno module entrypoints, CI, config and more.
- Host: GitHub
- URL: https://github.com/gjzwiers/mod
- Owner: GJZwiers
- License: mit
- Created: 2021-10-13T19:02:59.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-08-20T10:24:38.000Z (almost 4 years ago)
- Last Synced: 2025-10-24T04:36:43.650Z (8 months ago)
- Topics: cli, deno, javascript, typescript
- Language: TypeScript
- Homepage:
- Size: 521 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mod
[](https://deno.land/x/mod)

[](https://github.com/GJZwiers/mod/actions/workflows/build.yaml)
[](https://coveralls.io/github/GJZwiers/mod?branch=main)

> **Warning** This Deno module is deprecated. I recommend using `deno init`
> instead.
`mod` is a command line tool to quickly scaffold a new Deno module. It creates
app and dependency entrypoints, a `.gitignore` file and has options to add a
test-driven setup and/or include a basic CI pipeline.
Try it without any installation:
Bash/Zsh
```bash
deno run \
--allow-read \
--allow-run=git \
--allow-write=my_deno_module \
https://deno.land/x/mod/mod.ts \
--name my_deno_module
```
PowerShell
```console
deno run `
--allow-read `
--allow-run=git `
--allow-write=my_deno_module `
https://deno.land/x/mod/mod.ts `
--name my_deno_module
```
## Table of Contents
- [Installation](#installation)
- [Permissions](#permissions)
- [Usage](#usage)
- [Options](#options)
- [Contributing](#contributing)
## Installation
`mod` requires `deno` and optionally `git`. You can get the latest stable
release from `deno.land/x`:
```console
deno install --allow-read --allow-run=git --allow-write -fn mod https://deno.land/x/mod@v2.3.9/mod.ts
```
You can also get the _unstable_ canary release from GitHub by installing via the
`main` branch's raw URL:
```console
deno install --allow-read --allow-run=git --allow-write -fn mod https://raw.githubusercontent.com/GJZwiers/mod/main/mod.ts
```
## Permissions
`mod` requires the following permissions:
- `read`: to check if files already exists before writing.
- `run=git`: to run `git` commands, more specifically `git init`
- `write`: to make files as part of the module initialization.
Omitting `run` permissions is possible, but it means a Git repository will not
be initialized automatically.
## Usage
```console
mod
```
This will create the following file structure in the current working directory:
```
.
├── .gitignore
├── deps.ts
├── dev_deps.ts
├── mod.ts
```
Note that `mod` does not overwrite files unless `--force` is used explicitly.
This means the program can also be used to 'fill in the blanks' in a directory
where not all of the files above are present yet.
Also note that `mod` does not perform editor-specific setups such as enabling
Deno in VS Code via `.vscode/settings.json`.
If `git` is installed on the machine then `git init` will be run as well.
To create the new module in a new directory:
```console
mod --name my_deno_module
```
This will create the following file and directory structure:
```
.
├── my_deno_module
| ├── .gitignore
| ├── deps.ts
| ├── dev_deps.ts
| ├── mod.ts
```
`mod` can also create other files in addition to the basics, such as a workflow
file for GitHub Actions:
```console
mod -n my_deno_module --ci
```
```
.
├── my_deno_module
| ├── .github
| | ├── workflows
| | | ├── build.yaml
| ├── .gitignore
| ├── deps.ts
| ├── dev_deps.ts
| ├── mod.ts
```
You can also initialize with JavaScript:
```console
mod --js
```
```
.
├── .gitignore
├── deps.js
├── dev_deps.js
├── mod.js
```
## Options
`mod` can create other files with the module, such as an import map or a Deno
configuration file. To see what options and flags are available use:
- `mod --help` if you have the CLI installed or
- `deno run https://deno.land/x/mod/mod.ts --help`
## Contributing
Bug reports and feature requests are very welcome! If you want to contribute a
fix or feature yourself, fork this repository and make a pull request with your
changes.