This is the DenoLibs template for Deno compatible modules.
Press the Use this template button, and edit some files.
Which files?
- /lib/mod.ts - This is the main script of your module
- /readme.md - Your module's readme (this file)
We also recommend you write some tests in /test/mod.ts. There is a config included for Travis CI in this repository.
The run.bat file in the template is included to make running your module even easier!
Note: [args]
are optional arguments you may wish to pass to Deno or your module.
- Windows (Command Prompt)
run [args]
- Window (PowerShell)
.\run [args]
- Linux (BASH)
./run.bat [args]
There are likely other shells where this script will work, let us know and we'll add them!
Included in the template is an ESLint config (.eslintrc.js) that includes ESLint & Prettier support. This requires some dependancies, which are listed in package.json, and are installed with NPM.
To install the dependancies from a command line
$ npm install
To run the ESLint linter from a command line
$ node node_modules/eslint/bin/eslint.js lib/**
For automatic linting, we recommend VSCode the following packages/settings
{
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"[typescript]": {
"editor.formatOnSave": false
},
"eslint.enable": true,
"eslint.validate": [
{ "language": "typescript", "autoFix": true },
],
"eslint.autoFixOnSave": true,
}
This project is based on the open source DenoLibs / deno_template template.