All Projects → kawarimidoll → deno-dex

kawarimidoll / deno-dex

Licence: MIT license
🦕 A dexterous deno executor

Programming Languages

typescript
32286 projects

Labels

Projects that are alternatives of or similar to deno-dex

depsbot
⚙️ GitHub action to check freshness of your deno dependencies
Stars: ✭ 28 (+47.37%)
Mutual labels:  deno
dps-dial.vim
Increment/decrement plugin using denops.vim
Stars: ✭ 21 (+10.53%)
Mutual labels:  deno
deno rest
A Boilerplate for deno RESTful apis
Stars: ✭ 74 (+289.47%)
Mutual labels:  deno
postgres-deno
A PostgreSQL extension for Deno: run Typescript in PostgreSQL functions and triggers.
Stars: ✭ 87 (+357.89%)
Mutual labels:  deno
crux.land
crux.land is a free registry service meant for hosting small (≤ 20kB) single deno scripts.
Stars: ✭ 50 (+163.16%)
Mutual labels:  deno
sirdez
Glorious Binary Serialization and Deserialization for TypeScript.
Stars: ✭ 20 (+5.26%)
Mutual labels:  deno
lisan
🌈i18n, Reimagined! 🚀A blazing fast and super small i18n library for Javascript
Stars: ✭ 85 (+347.37%)
Mutual labels:  deno
deno sass
🚀 Cute Sass compiler bindings to Deno.
Stars: ✭ 13 (-31.58%)
Mutual labels:  deno
marky
A modular and extensible ESM and Deno Markdown parser.
Stars: ✭ 16 (-15.79%)
Mutual labels:  deno
attain
Deno API middleware Server
Stars: ✭ 79 (+315.79%)
Mutual labels:  deno
wasm
fast wasm modules
Stars: ✭ 37 (+94.74%)
Mutual labels:  deno
create-xc-app
⚡️ Create a project in seconds!
Stars: ✭ 15 (-21.05%)
Mutual labels:  deno
Ogone
Advanced Web Composition for Future
Stars: ✭ 38 (+100%)
Mutual labels:  deno
cache
🥌 Deno cache library
Stars: ✭ 38 (+100%)
Mutual labels:  deno
deno-bcrypt
A port of jBCrypt to TypeScript for use as a Deno module
Stars: ✭ 56 (+194.74%)
Mutual labels:  deno
wocket
A WebSocket library for Deno
Stars: ✭ 103 (+442.11%)
Mutual labels:  deno
deno doc
Documentation generator for Deno
Stars: ✭ 162 (+752.63%)
Mutual labels:  deno
http compression
🗜️ Deno HTTP compression middleware
Stars: ✭ 34 (+78.95%)
Mutual labels:  deno
parseargs
Migrated to https://github.com/denoland/deno_std
Stars: ✭ 28 (+47.37%)
Mutual labels:  deno
deno docker
Latest dockerfiles and images for Deno - alpine, centos, debian, ubuntu
Stars: ✭ 678 (+3468.42%)
Mutual labels:  deno

deno-dex

ci deno.land vr scripts LICENSE

A dexterous deno executor (only for development)

Commentary article in Japanese: https://zenn.dev/kawarimidoll/articles/d371abbd46b65b

Setup

Install by deno install:

deno install --allow-read --allow-write --allow-run --reload --force --name dex https://pax.deno.dev/kawarimidoll/deno-dex/main.ts

The reasons why these permissions are required are:

  • read: to watch file changes and current working directory
  • write: to save intermediate script file in $DENO_DIR
  • run: to run and kill process

Features

  • Run deno run or deno test for the file as argument.
    • Detect the file is for test or not.
    • Add --allow-all --unstable --no-check --watch for fast development.
  • There are several options.
    • --clear: Clear console every restart.
    • --watch: Watch changes of any files you specified.
    • Other options are passed to deno run or deno test transparently.
  • Auto-detect import maps and configuration files.
    • When dex starts without --import-map option and there is import_map.json, --import-map=import_map.json is implicitly added.
    • When dex starts without --config option and there is one of deno.jsonc, deno.json or tsconfig.json, --config=[one of them] is implicitly added.
    • The arguments of --import-map and --config are also passed to --watch option of dex.

Usage

Run the file by deno run:

dex hello.ts
# -> deno run --allow-all --unstable --no-check --watch hello.ts

Test the file by deno test if the file is test file:

dex hello_test.ts
# -> deno test --allow-all --unstable --no-check --watch hello_test.ts

For more details, see help:

dex --help

Caution

As written above, dex skips all checks (--allow-all --unstable --no-check). This increases productivity in development, but decreases security. Use it only for your own code.

When Deno.exit() is called, process will be stopped without restarting. This is same as normal deno run --watch behavior.

Vim/Neovim command

If you using Vim or Neovim, put the definition below in your configuration file to enable :Dex command.

command! -nargs=* -bang Dex silent only! | botright 12 split |
    \ execute 'terminal' (has('nvim') ? '' : '++curwin') 'dex'
    \   (<bang>0 ? '--clear' : '') <q-args> expand('%:p') |
    \ stopinsert | execute 'normal! G' | set bufhidden=wipe |
    \ execute 'autocmd BufEnter <buffer> if winnr("$") == 1 | quit! | endif' |
    \ wincmd k
  • :Dex to run dex with the current file in the terminal window under editor area.
    • :Dex accepts runtime options, like as :Dex --quite
  • :Dex! is shorthand of :Dex --clear

Acknowledgements

--watch option is heavily inspired by this article.

Build a live reloader and explore Deno! 🦕 - DEV Community


if (this.repo.isAwesome || this.repo.isHelpful) {
  star(this.repo);
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].