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
somewhere in the dependency tree.default-features = false 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.
- Compile with
cargo build --profile=release-with-debug --features=dhat-heap
- Run the executable. It will output a dhat-heap.json file.
- Open the json file in https://nnethercote.github.io/dh_view/dh_view.html
- Compile with
- 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.