Cargo Features

[dependencies]
deno = { version = "2.0.5", default-features = false, features = ["dhat-heap", "upgrade", "hmr"] }
default = upgrade

These default features are set whenever deno is added without default-features = false somewhere in the dependency tree.

Enables zlib-ng of libz-sys and zlib-ng-compat of flate2

If you disable the default __vendored_zlib_ng feature above, you must be able to link against -lz.

dhat-heap = dhat

A feature that enables heap profiling with dhat on Linux.

  1. Compile with cargo build --profile=release-with-debug --features=dhat-heap
  2. Run the executable. It will output a dhat-heap.json file.
  3. Open the json file in https://nnethercote.github.io/dh_view/dh_view.html
upgrade default

A feature that enables the upgrade subcommand and the background check for available updates (of deno binary). This is typically disabled for (Linux)
distribution packages.

hmr

A dev feature to disable creations and loading of snapshots in favor of loading JS sources at runtime.

Enables hmr of deno_runtime

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

dhat dhat-heap?