Skip to content

Minimalistic boilerplate to quick-start Deno 2.1 development in TypeScript.

License

Notifications You must be signed in to change notification settings

jiifw/deno-ts-boilerplate

Repository files navigation

deno-ts-boilerplate

Developer Ready: A comprehensive template. Works out of the box for most Deno projects.

Instant Value: All basic tools included and configured:

  • Bundled TypeScript.
  • Deno Lint with some initial rules' recommendation.
  • Deno Test for fast unit testing and code coverage.
  • Deno Format to enforce consistent code style.
  • Deno tasks for common operations.
  • .editorconfig for consistent file format.
  • Simple example of TypeScript code and unit test.
  • Use all ES6 features (including experimental and proposal).
  • Minimal .env files for environment customization.
  • Clean imports: No relative files path.
  • Zero dependencies: Install your own packages.
  • Deno Cron as a task schedular.
  • PM2 as a process manager.

🤲 Free as in speech: available under the APLv2 license.

Getting Started

This project is intended to be used with the latest Active LTS release of Deno.

If you don't have Deno 2.1+, Check installation guide here.

Use as a repository template

To start,

  1. Install PM2 process manager globally: deno install --global npm:pm2
  2. Clone this repository.
  3. Copy .env.sample to .env.
  4. Install dependencies by deno install.
  5. Start adding your code in the src and unit tests in the __tests__ directories.

Clone repository

To clone the repository, use the following commands:

git clone https://github.com/jiifw/deno-ts-boilerplate
cd deno-ts-boilerplate
deno install

Download latest release

Download and unzip the current master branch or one of the tags:

wget https://github.com/jiifw/deno-ts-boilerplate/archive/master.zip -O deno-ts-boilerplate.zip
unzip deno-ts-boilerplate.zip && rm deno-ts-boilerplate.zip

Available Scripts

  • start - serve built project.
  • start:dev - interactive watch mode to automatically transpile source files.
  • start:debug - interactive watch mode with debugger to automatically transpile source files.
  • cron - starts the experimental cron scheduler
  • clean - remove coverage data, Jest cache, transpiled files and runtime files.
  • lint - lint source files and tests.
  • fromat - reformat files.
  • test - run tests.
  • test:watch - interactive watch mode to automatically re-run tests.
  • pm2:start - PM2 specific start service(s).
  • pm2:stop - PM2 specific stop service(s).
  • pm2:delete - PM2 specific delete service(s).

License

Licensed under the APLv2. See the LICENSE file for details.