As the Nuggets open their first technical feature, “Talk about Deno,” a new Deno article is coming on deadline (08/04). After reading the Deno soliciting papers of other partners, There are Deno TCP Echo Server, TDD practice on Deno, Deno program how to call Rust, Deno command line development scheme, Deno build a simple Router, Deno simple application and Deno from entry to run, Deno From zero to architecture development and so on, each article is very vivid and wonderful. So… If you read this article in the last two days and think it’s helpful, please like my nuggets article and it will give me a nice nugget gift. If you read it in the future, please click here.

  • Portal: juejin.cn/user/370281…

The topic of this article is “Reading through the Deno architecture”, and the direction is the “command line command read through” perspective. On the topic of “reading through Deno architecture,” it feels like a whole series of articles could be dug into the source code from the CLI, the standard library, the kernel, and the tool library.

As you can see from the command line, Deno has built-in tools for testing, packaging, formatting, Linter, installing dependencies, etc. In Node, we may need to find and select a large number of third-party libraries to fill each function. Take a look at some of the tools available. This paper was written 14h+, and a large number of directory structures precipitated after reconstruction are as follows:

  • Read through basic command line information: read through common commands, built-in toolkits, and environment variables from deno –help;
  • Read through Deno general instruction: read through the general instruction one by one;
  • Read through the Deno built-in toolkit: read through the 14 key features of Deno built-in tools one by one;
  • Read through Deno environment variables: Separate environment variables for parsing;

The Deno Delve series will be released on the day of the Deno V1 release, and will be updated periodically on Github (github.com/hylerrix/de… ✨), the website (deno-tutorial.js.org). Let’s learn Deno step by step, first easy and then difficult to complement Node, for the future development of their own Deno Web App. Welcome to subscribe, welcome to communicate.

Read through the basic command line information

deno –help, help

The quickest and most practical way to understand a command is to read its help documentation directly. Each line of help information is a short, critical introduction that is not difficult to understand and translate. The terminal enters the following command (help or –help is used to print the global help information or the help information for the stator command) :

$ deno --help
Copy the code

To get the basic help information of Deno:

  • Deno 1.2.2 (2020-08-01)
  • A secure JavaScript and TypeScript runtime
  • Documents: deno. Land/manual
  • Module: deno.land/ STD/deno.land/x/
  • Bugs:github.com/denoland/de…
  • Usage: deno [OPTIONS] [subcommand]
# Start in REPL mode:
$ deno
# Execute a script:
$ deno run https://deno.land/std/examples/welcome.ts
# Execute a piece of code in the Shell:
$ deno eval "console.log(30933 + 404)"
Copy the code

Aggregate 26 general instructions

Here’s an overview of the common instructions, combining the options that appear in deno –help with the options that you would normally see in the help information of the 14 built-in toolkits (if a command is used twice or more, it’s considered common, and it covers almost all of them) :

  • P.S: I almost chose “parameter” when I was trying to decide whether to call it “parameter” or “option” or “directive”. I finally chose “directive”.

Note: It took me a few hours to compile this chart, so don’t forget to give it a thumbs up if it helps you. Dig a hole: You can draw a mind map later. In the meantime, if anything went wrong, feel free to comment on Github Repository Issues in the comments section.

The serial number options What tools are available? use
01 -h, –help all Printing Help Information
02 -L, –log-level all Set the log level [possible values: debug, info]
03 -q, –quiet all Disable diagnostic output; By default, subcommands print readable diagnostic messages to stderr; If this flag is set, these messages are limited to errors
04 -A, –allow-all run, install, test Allow all permissions, which will disable all security restrictions
05 –allow-env run, install, test Allows environment access, such as reading and setting environment variables
06 –allow-hrtime run, install, test Allow high precision time measurement, high precision time can be used in timing attacks and feature recognition
07 –allow-net= run, install, test Allow network access. You can specify a list of comma-separated domain names to provide a whitelist of domain names
08 –allow-plugin run, install, test Allows plug-ins to be loaded. Please note: this is currently an unstable feature
09 –allow-read= run, install, test Allows file system reading. You can specify a series of comma-separated directories or files to provide a file system whitelist.
10 –allow-run run, install, test Allows child processes to run. Please note that child processes do not run in a sandbox and therefore do not have the same security restrictions as denO processes, so use with caution
11 –allow-write= run, install, test Allows writing to the file system. You can specify a series of comma-separated directories or files to provide a file system whitelist
12 –cert run, install, bundle, chche, eval, info, test, upgrade, repl Load the certificate authority from the file encoded in PEM
13 -c, –config run, install, budle, cache, test Read the tsconfig.json configuration file
14 –unstable run, install, bundle, cache, doc, eval, fmt, info, lint, test, types, repl Enable unstable APIs support
15 –inspect=HOST:PORT run, eval, test, repl Activate listener host: Port (default: 127.0.0.1:9229)
16 –inspect-brk=HOST:PORT run, eval, test, repl The listener is activated on the host: port and interrupted when the user script starts
17 –v8-flags= run, eval, test, repl Set V8 command-line options. Help: – v8 – flags = — help
18 –cached-only run, test Requires that remote dependencies have been cached
19 -r, –reload=<CACHE_BLOCKLIST> run, cache, doc, test Reload the source cache (recompile TypeScript). Reloads all/only standard/specific modules
20 –lock run, bundle, cache, test Check the specified lock file
21 –lock-write run, bundle, cache, test Writes to the lock file, used with –lock
22 –no-check run, cache, info, test Disable TypeScript type checking, which greatly reduces startup time
23 –no-remote run, cache, test Remote modules are not parsed
24 –seed run, test Math. The random seed ()
25 –importmap run, install, bundle, test Unstable: Read import map file
26 –json doc, info Output the document in JSON format

The specific general instructions are discussed in the “Read through Deno General Instructions” section.

Put together 14 built-in toolkits

The 14 built-in tools are briefly described in the help message (to emphasize the independence of each tool, these tools are temporarily translated as “XX tools”) :

The serial number The name of the The command function
01 runner deno run Run the program with the specified file name or URL. Read from standard input using “-” as the file name
02 Script installer deno install Install the script as an executable
03 Packaging machine deno bundle Package modules and dependencies into a single file
04 cache deno cache Cache depend on
05 Document generator deno doc Displays a document for a module
06 actuator deno eval Execute a script
07 formatter deno fmt Formatting source files
08 Dependency inspector deno info Displays information about the cache or about the source file
09 Specification is deno lint Normalized source file
10 tester deno test Perform the test
11 Type machine deno types Print runtime TypeScript declarations
12 Completion is deno completions The Shell completion information is generated
13 updater deno upgrade Upgrade the Deno executable to the given version
14 REPL device deo repl Read/execute/print/loop

The detailed tools are described in the “Reading through the Deno Built-in Toolkit” section.

Summarize the six basic environment variables

The six environment variables are outlined in the help information:

The serial number The variable name use note
01 DENO_DIR Setting the cache directory
02 DENO_INSTALL_ROOT Set the directory for importing the Deno software package Defaults to $HOME /. Deno/bin
03 NO_COLOR Disable the use of colors
04 DENO_CERT Loads a certificate authority from a file encoded in PEM
05 HTTP_PROXY Proxy address of the HTTP request The modules Downloads and FETCH
06 HTTPS_PROXY Proxy address for HTTPS requests The modules Downloads and FETCH

The basic environment variables are discussed in the “Reading Through Deno Environment Variables” section.

Read through the Deno general instruction

The actual code is included in demos/ Ningowood/v1-CLI-example in the Deno Delve into Art repository.

This chapter lists the 14 built-in tools in descending order of their use.

(01) –log-level/–quiet

These two instructions are available to all built-in tools.

In –log-level, you can add debug or info to set the log level. When the command is set to debug, the following information is displayed: This is very detailed information, a simple startup and network access will print a log of many lines.

$ deno run --allow-net --log-level debug main.ts
Deno isolate init with snapshots.
rust:shared_queue:reset
DEBUG JS - cwd /Users/{$HOME}/WorkSpace/Hylerrix/deno-tutorial/demos/ningowood/v1-cli-example
DEBUG JS - args []
...
⚠️️  Granted network access to "0.0.0.0:8000"New Listener 3 0.0.0.0:8000 Welcome to Deno πŸ¦• http://localhost:8000/ DEBUG js-sendAsync op_acceptCopy the code

— The quiet directive was proposed in the Issues issue on October 20 (#3162), and was added on March 10 (2020-03-10). One of the goals is to solve the problem of running the same program multiple times but getting different output. This directive is described in the official documentation as limiting otherwise readable diagnostic messages to generic error types.

(02) –unstable/–cert/–config

These three instructions are the top three most used in addition to all instructions –log-level and –quiet.

–unstable allows a program to execute with an unstable API list. What kind of API is unstable? The official website document answers this:

Even though the Deno namespace API stabilised with Deno V1, not all of Deno’s features were ready for production. Because the unprepared feature is still in draft form, it is locked after the –unstable command line flag.

Unstable apis are mostly not security checked, major API changes may occur in the future, and are not ready for production.

Also, Deno’s standard module (DENO. land/ STD /) is unstable. The current Deno version of the standard module differs from the CLI to emphasize instability. Note that unlike the Deno namespace, the –unstable flag is not required to use the standard module (unless the standard module itself uses the unstable Deno feature). Test method:

$ deno install --unstable --allow-read --allow-write --allow-net https://deno.land/x/pagic/mod.ts
Copy the code

–cert is used to load a certificate authority from a PEM encoded file. So here’s the question:

  • What is PEM? PEM is a container format. It can contain only public certificates, or it can include the complete certificate chain, including the public key, private key, and root certificate. The name comes from the network security domain of a private Mail type Privacy Enhanced Mail.
  • PEM format? “– — — — — the BEGIN…” The beginning, “– — — — — END…” At the end, the content is ASCII (Base64) encoded.
  • Query information about the PEM certificate? Openssl x509 -in certificate-pem -text -noout.

–config is used to read the tsconfig.json file, but it can also read other files as tsconfig.json.

deno run --allow-net main.ts --config tsconfig.json
Copy the code

(03) –inspect*/–v8-flags

Each of these instructions is available only in the run, eval, test, or repl toolkits.

Deno supports the V8 Inspector Protocol. Use the –inspect or –inspect-brk commands to debug Deno programs on Chrome Devtools or other clients that support the V8 Inspector Protocol, such as VSCode.

–inspect allows the debugger to connect at any point in time, whereas the –inspect-brk option waits for the debugger to connect, pausing execution at the first line of code. Enter the following code to open Chrome ://inspect and click inspect next to target to debug it:

$ deno run --inspect-brk --allow-read --allow-net https://deno.land/std/http/file_server.ts Debugger listening on Ws: / / 127.0.0.1:9229 / ws / 4947 ac73 - fd2 b9fc - 4-9336 - c6071f4f3e9e Debugger session started. The Debugger session ended: WebSocket Protocol error: Connection reset without closing handshake. HTTP server listening on http://0.0.0.0:4507/Copy the code

–v8-flags changed from –v8-options on November 21 (#3389) to –v8-flags, responsible for setting v8 command-line options. The specific parameters can be understood as follows:

$ deno run --v8-flags=--helpmain.ts SSE3=1 SSSE3=1 SSE4_1=1 SSE4_2=1 SAHF=1 AVX=1 FMA3=1 BMI1=1 BMI2=1 LZCNT=1 POPCNT=1 ATOM=0 Synopsis: shell [options] [--shell] [<file>...]  d8 [options] [-e <string>] [--shell] [[--module] <file>...] .Copy the code

(04) –allow-*

–allow-* is only used by the run, install, and test tools as a whole.

  • -a, –allow-all: allows all permissions, which disables all security restrictions.
  • –allow-env: Allows environment access, such as reading and setting environment variables
  • –allow-hrtime: Allows high precision time measurement. High precision time can be used in timing attacks and feature recognition
  • –allow-net: allows network access. You can specify a list of comma-separated domain names to provide a whitelist of domain names
  • –allow-plugin: allows plug-ins to be loaded. Please note: this is currently an unstable feature
  • –allow-read: allows the file system to be read. You can specify a series of comma-separated directories or files to provide a file system whitelist.
  • –allow-run: Allows child processes to run. Please note that child processes do not run in a sandbox and therefore do not have the same security restrictions as denO processes, so use with caution
  • –allow-write: allows writing to the file system. You can specify a series of comma-separated directories or files to provide a file system whitelist

In Denon (which listens for all changes in the Deno application and restarts automatically, and can be configured for more), you can simply set this in denon.config.ts:

import { DenonConfig } from "https://deno.land/x/denon/mod.ts"
import { config as env } from "https://deno.land/x/dotenv/mod.ts"

const config: DenonConfig = {
  scripts: {
    start: {
      allow: [ "env"."net"."read"."write"."plugin"],... }export default config
Copy the code

Perform denon start. This will replace the default with:

$ deno run --allow-net --allow-env --allow-write --allow-read --allow-plugin --unstable main.ts
Copy the code

(05) –cached-only/–seed

These two instructions are only used by the run and test tools.

— cacheded-only Requires that the remote dependency has been cached. When we use this command to run a Deno program from a remote location where the package has not been cached, we can’t find the package from the cache:

$ deno run --allow-net --cached-only not-cache.ts
error: Cannot find module "https://deno.land/x/[email protected]/mod.ts"
from "file:///Users/{$HOME}/WorkSpace/Hylerrix/deno-tutorial/ ... demos/ningowood/v1-cli-example/not-cache.ts" in cache, --cached-only is specified
Copy the code

–seed Provides random seed values for the program. How does the program get this random value? Leave it to think about later.

$ deno run --allow-net --seed 1 main.ts
Copy the code

(06) –reload/–lock*/.–no-*

These five instructions are the last remaining instructions and are used by the following tools:

  • –reload: run, cache, doc, test
  • — Lock: run, bundle, cache, test
  • –lock-write: run, bundle, cache, test
  • –no-check: run, cache, info, test
  • –no-remote: run, cache, test

–reload will cache the source code and recompile TypeScript, including:

  • –reload: reloads all source code
  • –reload=deno.land/ STD: reload=deno.land…
  • — reload = deno. Land/STD/fs/util…

–lock and –lock-write are used to check for locked files, because it is important to manage and lock file versions in a bewildering array of library versions. –no-check Disables TypeScript type checking, greatly reducing startup time; –no-remote specifies whether to parse the remote module.

$ deno run --allow-net --reload main.ts $ deno run --allow-net --lock lock.json main.ts Subresource integrity check Json https://deno.land/[email protected]/ textProto /mod.tsa $deno run --allow-net --no-check main.ts $deno run --allow-net --no-remote main.tsCopy the code

Read through the Deno built-in toolkit

The actual code is included in demos/ Ningowood/v1-CLI-example in the Deno Delve into Art repository.

Because this article in “read through Deno general instructions section” will be Deno built-in toolkit reusable instructions have been introduced one by one. This chapter focuses on the independence of the 14 built-in toolkits (named after xx in Chinese) in the form of a directory, and some unique introduction in addition to the general instructions.

(01) Run: deno Run

The run tool supports nearly 100% of the general instruction list (except for the — JSON directive), and the general instruction examples in the previous chapter are all run, so there’s no need to go into it here.

  • Deno-run: Executes a module program, which can be a file name or URL.
  • Usage:Deno run [OPTIONS] < script parameters >...
  • Common examples:
By default, all programs run in a secure sandbox, unable to access disk, network, or generate child processes.
$ deno run https://deno.land/std/examples/welcome.ts
# Grant all permissions
$ deno run -A https://deno.land/std/http/file_server.ts
# Give read and network listen permissions:
$ deno run --allow-read --allow-net https://deno.land/std/http/file_server.ts
# Give read permission to the disk directory whitelist:
$ deno run --allow-read=/etc https://deno.land/std/http/file_server.ts
# Deno allows you to specify filename "-" to read files from stdin.
$ curl https://deno.land/std/examples/welcome.ts | target/debug/deno run -
Copy the code

(02) Script installer: deno install

  • Deno-install: Installs the script as an executable file in the bin directory of the root directory of the installation path.
  • Usage:Deno install [OPTIONS]...
  • Unique instructions:
    • -f, --force: Forces an existing installation to be overwritten
    • -n, --name <NAME>: Specifies the executable name
    • --root <PATH>: Installation path
  • Common examples:
$ deno install --allow-net --allow-read https://deno.land/std/http/file_server.ts
$ deno install https://deno.land/std/examples/colors.ts
To change the name of the executable, use -n/-name:
$ deno install --allow-net --allow-read -n serve https://deno.land/std/http/file_server.ts
Executable file names are inferred by default:
# - Try to get the URL path file structure. As in the example above
# become 'file_server'.
# - If the file structure is a generic name (such as "main", "mod", "index" or "cli") and the path does not have a parent, use the name of the parent path. Otherwise, use a generic name.
# To change the installation root directory, use --root:
$ deno install --allow-net --allow-read --root /usr/local https://deno.land/std/http/file_server.ts
# Determine the root directory of the installation path by priority:
# - --root option
# -deno_install_root Environment variable
# - $HOME/.deno
You must manually add them to the path if needed.
Copy the code

(03) Bundle: Deno Bundle

  • Deno-bundle: packages.
  • Usage:deno bundle [OPTIONS] <source_file> [out_file]
  • Common examples:
# Enter a separate JavaScript file with all related dependencies:
$ deno bundle https://deno.land/std/examples/colors.ts colors.bundle.js
If no input file is specified, the input will be written to the standard output stream:
$ deno bundle https://deno.land/std/examples/colors.ts
Copy the code

(04) Cache: deno Cache

  • Deno-cache: Cache and compile remote dependencies recursively
  • Usage:deno cache [OPTIONS] <file>...
  • Common examples:
Download and compile the module that includes all static dependencies and save it in
# Local cache, no need to run any code:
$ deno cache https://deno.land/std/http/file_server.ts
# Will not trigger download or compile unless you run this module later
# --reload is specified.
Copy the code

(05) Document generator: deno Doc

  • Deno-doc: Displays the documentation for a module

  • Deno doc [OPTIONS] [ARGS]

  • Unique instructions:

    • --private: Outputs private documents
  • Common examples:

Output the document to the standard input stream:
$ deno doc ./path/to/module.ts
Output private documents to the standard output stream:
$ deno doc --private ./path/to/module.ts
Output the document in JSON format:
$ deno doc --json ./path/to/module.ts
# to locate a specific symbol:
$ deno doc ./path/to/module.ts MyClass.someField
# Display runtime built-in documents:
$ deno doc
$ deno doc --builtin Deno.Listener
Copy the code

(06) Executor: deno eval

  • Deno-eval: Executes code.

  • Deno eval [OPTIOS]

  • Unique instructions:

    • -p, --print: Prints the result to the standard output stream
    • -T, --ts: Treats input as TypeScript
  • Common examples:

Execute JavaScript from the command line.
$ deno eval "console.log('hello world')"
Execute in TypeScript mode:
$ deno eval -T "const v: string = 'hello'; console.log(v)"
# This command has implicit access to all permissions (--allow-all).
Copy the code

(07) Formatter: Deno FMT

  • Deno-fmt: Automatically formats JavaScript/TypeScript source code.
  • Usage:deno fmt [OPTIONS] [FILE]...
  • Unique instructions:
    • --check: Checks whether the source file is formatted
    • --ignore=<ignore>: Ignores formatting specific source files. Used with –unstable.
  • Common examples:
$ deno fmt --help
$ deno fmt
$ deno fmt myfile1.ts myfile2.ts
$ deno fmt --check
Format standard input stream and output to standard output stream:
$ cat file.ts | deno fmt -
# Ignore this line of code formatting by prefixing it with an ignore comment:
# // deno-fmt-ignore
Ignore the file formatting by adding an ignore comment at the top of the file:
# // deno-fmt-ignore-file
Copy the code

(08) Dependency inspector: deno Info

  • Deno-info: Information about a module or cache directory.
  • Usage:deno info [OPTIONS] [FILE]
  • Common examples:
# Get information about modules:
$ deno info https://deno.land/std/http/file_server.ts
# Displays the following information:
# local: Local path of the file
# type: JavaScript, TypeScript or JSON.
Compiled: local path where the source code was compiled. (TypeScript only)
# map: the local path of the source map. (TypeScript only)
# deps: dependency tree for source files.
# Without any other parameters, "deno Info" will display:
# DENO_DIR: directory containing Deno management files.
# Remote Modules cache: the subdirectory containing the downloaded Remote modules.
# TypeScript Compiler Cache: subdirectory containing TS compiler output.
Copy the code

(09) Specification: deno Lint

  • Deno-lint: Specifies JavaScript/TypeScript source code.
  • Unique instructions:
    • –rules: Lists available rules
  • Usage: deno lint[OPTIONS] [FILE]...
  • Common examples:
$ deno lint --unstable
$ deno lint --unstable myfile1.ts myfile2.js
# List available rules:
$ deno lint --unstable --rules
Ignore the diagnosis on the next line by prefixing it with an ignore comment, rule name:
# // deno-lint-ignore no-explicit-any
# // deno-lint-ignore require-await no-empty
You must specify the name of the rule to ignore after ignoring the comment.
# ESLint also supports ignoring comments:
# // eslint-ignore-next-line @typescrit-eslint/no-explicit-any no-empty
Ignore the entire file by adding an ignore comment at the top of the file:
# // deno-lint-ignore-file
Copy the code

(10) Tester: DENo Test

  • Deno-test: Run tests using deno’s built-in test runner.
  • Usage:Deno test [OPTIONS] [file name]...
  • Unique instructions:
    • –allow-none: No error code is returned if the test file is not found
    • –failfast: Stop when the first error occurs
    • –filter: Run the test using this string or pattern in the test name
  • Common examples:
# Execute the given module, run all tests declared by 'deno.test ()', and print the results to the standard output stream:
$ deno test src/fetch_test.ts src/signal_test.ts
The directory parameter is extended to all include files that match glob
_, and # {* *.,} test. {js, MJS, ts, JSX, TSX} :
$ deno test src/
Copy the code

(11) Deno types

  • Deno-types: Print runtime TypeScript declarations.
  • Usage:deno types [OPTIONS]
  • Common examples:
$ deno types --help
$ deno types > lib.deno.d.ts
The declaration file can be saved and used to input new content.
Copy the code

(12) Completions: deno completions

  • Deno -completions: Input shell completion information to the standard output stream.
  • Usage:deno completions [OPTIONS] <shell>
  • Common examples:
$ deno completions bash > /usr/local/etc/bash_completion.d/deno.bash
$ source /usr/local/etc/bash_completion.d/deno.bash
# [shell possible values: ZSH, bash, fish, Powershell, elvish]
Copy the code

(13) deno upgrade

  • Deno-upgrade: upgrades the DENO executable to a given version.
  • Usage:deno upgrade [OPTIONS]
  • Unique instructions:
    • --dry-run: Performs all checks without replacing the old EXE
    • -f, --force: Replace the current EXE even if it is not expired
    • --output <output>: Indicates the path to which the updated version is output
    • --version <version>: Indicates the version number you want to upgrade to
  • Common examples:
$ deno upgrade --help
The default is to update to the latest version.
Download this version from here:
# https://github.com/denoland/deno/releases
# and is used to replace the current executable.
If you do not want to replace the current Deno executable, but instead download a new version to another location, use the --output flag
$ deno upgrade --output $HOME/my_deno
Copy the code

(14) REPL: deno REPL

  • Deno-repl: Read execution print loop
  • Usage:deno repl [OPTIONS]
  • Common examples:
$ deno repl # deno
Copy the code

Read through the Deno environment variables

The actual code is included in demos/ Ningowood/v1-CLI-example in the Deno Delve into Art repository.

(01) DENO_DIR

DENO_DIR defaults to $HOME/.cache/deno, but can be set to any path. This is where Deno stores the generated code and the cached source code.

Enter deno Info to see your cache location, which provides directories dedicated to remote modules and TypeScript compilation locations.

$ deno info
# DENO_DIR location: "/Users/{$HOME}/Library/Caches/deno"
# remote module cache location: "/ Users / {$HOME} / Library/Caches/deno deps"
# TypeScript cache location: "/Users/{$HOME}/Library/Caches/deno/gen"
$ tree -L 2 /Users/{$HOME} / Library/Caches/deno β”œ ─ ─ deno_history. TXT β”œ ─ ─ deps β”‚ β”œ ─ ─ HTTP β”‚ β”” ─ ─ HTTPS β”œ ─ ─ gen β”‚ β”œ ─ ─ XXX. Js β”‚ β”œ ─ ─ XXX. Js. Map β”‚ β”œ ─ ─ File β”‚ β”œβ”€ HTTPS β”‚ β”œβ”€ β”œβ”€ lib. D.ts β”‚ β”œβ”€ lib. Deno_runtime.d.tsCopy the code

(02) DENO_INSTALL_ROOT

The default value is $HOME/.deno/bin. Enter the following command to see how many Deno programs I currently have installed globally:

$ tree /Users/{$HOME} /. Deno. β”” ─ ─ bin β”œ ─ ─ Trex β”œ ─ ─ Trex_Cache_Map β”œ ─ ─ deno β”œ ─ ─ denon β”œ ─ ─ pagic β”” ─ ─ vrCopy the code

(02) NO_COLOR

If NO_COLOR is set, Deno will disable color output (no-color.org). User code can test whether NO_COLOR is set by using the Boolean constant deno. noColor, which does not require environment permissions (–allow-env).

$ deno run var.ts 
Check file:///Users/didi/WorkSpace/Hylerrix/deno-tutorial/demos/ningowood/v1-cli-example/no-color.ts
false
Copy the code

(03) DENO_CERT & HTTP*_PROXY

Leave a blank space to guess how to use it.

Summary & Subscription

At this point, “read through Deno V1. x features from CLI commands” article is complete. In the process of writing for 14h+, I have generated a lot of inspiration, and I am interested in more content and think I can dig deeper. But there is a limit to how much you can carry in a single article, so I’ll put off any interesting topics you might want to think about. At the same time, it is likely that more instructions will be introduced as new features in the future, and perhaps some instructions will not be included because they are not included in the documentation help information.

In short, there are many places to continue learning! There are so many different ways to learn about Deno. Look forward to a more comprehensive understanding of Deno CLI features as we do more programming together.

Subscribe to? You know:

  • Warehouse: github.com/hylerrix/de…
  • Website: deno-tutorial.js.org
  • Me:github.com/hylerrix