Cargo Features
[dependencies]
rustyscript = { version = "0.10.0", default-features = false, features = ["safe_extensions", "all_extensions", "network_extensions", "io_extensions", "extra_features", "node_experimental", "web_stub", "broadcast_channel", "cache", "console", "cron", "crypto", "ffi", "fs", "http", "kv", "io", "url", "web", "webgpu", "webidl", "webstorage", "websocket", "fs_import", "url_import", "snapshot_builder", "worker", "toml"] }
- default = safe_extensions, worker
-
These default features are set whenever
rustyscript
is added without
somewhere in the dependency tree.default-features = false - safe_extensions default = console, crypto, url, web_stub
-
Feature groups
Extensions that are safe to use in a sandboxed environment These extensions do not provide access to the network or filesystem - all_extensions node_experimental? = io_extensions, network_extensions
-
Enables all available extensions, except for node support These extensions are not safe to use in a sandboxed environment without additional restrictions (See [WebPermissions]
- network_extensions all_extensions? = broadcast_channel, console, crypto, http, url, url_import, web, websocket, webstorage
-
Extensions that provide access to the network. Also enables URL imports from JS These extensions are not safe to use in a sandboxed environment without additional restrictions (See [WebPermissions]
- io_extensions all_extensions? = cache, console, cron, ffi, fs, fs_import, io, kv, web, webgpu, webstorage
-
Extensions that provide access to the filesystem. Also enables file imports from JS These extensions are not safe to use in a sandboxed environment without additional restrictions (See [FsPermissions]
- extra_features = snapshot_builder, worker
-
Additional features that are not part of the core runtime These features are safe to use in a sandboxed environment without additional restrictions
- node_experimental = all_extensions, checksum, deno_napi, deno_node, deno_npm, deno_resolver, deno_runtime, deno_semver, node_resolver
-
Highly experimental NodeJS compatibility layer. Enables all other extensions Enables the use of the node and npm modules
CJS support not yet implemented
These extensions are not safe to use in a sandboxed environment without additional restrictions (See [NodePermissions]Affects
ext::napi
,ext::node
,ext::runtime
,ext::ExtensionOptions.node_resolver
,inner_loader::LoaderOptions.node_resolver
…Required by the update_deno binary
- web_stub safe_extensions = base64-simd, webidl
-
By default, an extension stub is included in the runtime if the
web
feature is disabled It provides a minimal set of APIs for parts of the runtime, such as timers and the DOM exception class It maintains sandboxing by not providing access to the network or filesystemIt does however require the webidl extension to be enabled By disabling this feature, you can opt out of the web stub extension, and the webidl extension
The primary use-case for this is for creating a runtime using a deno_core version incompatible with the deno extensions
Note that by turning off both web_stub and web, btoa/atob and timer APIs will not be available
Affects
ext::web_stub
… - broadcast_channel network_extensions? = deno_broadcast_channel, web, webidl
-
Each feature in this section corresponds to a different deno extension I have annotated each with the section of the w3c spec that it implements
Affects
ext::broadcast_channel
,ext::ExtensionOptions.broadcast_channel
… - cache io_extensions? = deno_cache, web, webidl
-
Affects
ext::cache
,ext::ExtensionOptions.cache
… - console cron? io_extensions? kv? network_extensions? safe_extensions web? = deno_console, deno_terminal
-
Affects
ext::console
… - cron io_extensions? = console, deno_cron
-
Implements scheduled tasks (crons) API
Affects
ext::cron
… - crypto network_extensions? safe_extensions web? = deno_crypto, webidl
-
Affects
ext::crypto
,ext::ExtensionOptions.crypto_seed
… - ffi io_extensions? = deno_ffi
-
Dynamic library ffi
Affects
ext::ffi
… - fs io_extensions? = deno_fs, io, web
-
Provides ops for interacting with the file system.
Affects
ext::fs
,ext::ExtensionOptions.filesystem
… - http network_extensions? = deno_http, web, websocket
-
Affects
ext::http
… - kv io_extensions? = console, deno_kv, web
-
https://github.com/denoland/denokv/blob/main/proto/kv-connect.md
Affects
ext::kv
,ext::ExtensionOptions.kv_store
… - io fs? io_extensions? = deno_io, libc, nix, once_cell, rustyline, web, winapi
-
Provides IO primitives for other Deno extensions (stdio streams, etc)
Affects
ext::io
,ext::ExtensionOptions.io_pipes
… - url network_extensions? safe_extensions web? = deno_url, webidl
-
https://url.spec.whatwg.org/ https://wicg.github.io/urlpattern/
Affects
ext::url
… - web broadcast_channel? cache? fs? http? io? io_extensions? kv? network_extensions? webgpu? websocket? = console, crypto, deno_fetch, deno_net, deno_permissions, deno_tls, deno_web, fs_import, hyper-util, url, url_import, webidl
-
Timers, events, text encoder/decoder, https://w3c.github.io/FileAPI https://fetch.spec.whatwg.org/
Enables http
Affects
ext::web
,ext::ExtensionOptions.web
… - webgpu io_extensions? = deno_webgpu, web
-
Affects
ext::webgpu
… - webidl broadcast_channel? cache? crypto? url? web? web_stub? webstorage? = deno_webidl
-
Affects
ext::webidl
… - webstorage io_extensions? network_extensions? = deno_webstorage, webidl
-
Affects
ext::webstorage
,ext::ExtensionOptions.webstorage_origin_storage_dir
… - websocket http? network_extensions? = deno_websocket, web
-
Affects
ext::websocket
… - fs_import io_extensions? web?
-
Features for the module loader
- fs_import allows arbitrary file imports
- url_import allows importing from the web
Both fs_import and url_import will break sandboxing - url_import network_extensions? web? = reqwest
- snapshot_builder extra_features?
-
Enables the use of the SnapshotBuilder runtime
It is used to create a snapshot of a runtime for faster startup times - worker default extra_features?
-
Enables the threaded worker API
Affects
rustyscript::worker
…
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.
End of feature definitions
- hyper-util web?
-
Enables hyper-util =0.1.7
For web
- reqwest url_import?
-
Enables reqwest =0.12.8
For URL imports
Pinned for now due to upstream issues - deno_permissions web?
- toml implicit feature
-
Enables toml
For dependency management only
Required by the update_deno binary
- deno_broadcast_channel broadcast_channel?
-
Enables deno_broadcast_channel
Dependencies for the various extension features
- deno_cache cache?
- deno_console console?
- deno_cron cron?
- deno_crypto crypto?
- deno_fetch web?
- deno_ffi ffi?
- deno_fs fs?
- deno_http http?
- deno_kv kv?
- deno_net web?
- deno_node node_experimental?
- deno_tls web?
- deno_url url?
- deno_web web?
- deno_webidl webidl?
- deno_webstorage webstorage?
- deno_websocket websocket?
- deno_webgpu webgpu?
- deno_io io?
- rustyline io?
-
Enables rustyline
Dependencies for the IO feature
- winapi io?
- nix io?
- libc io?
- once_cell io?
- base64-simd web_stub?
-
Enables base64-simd
Dependencies for the web stub feature
- deno_resolver node_experimental?
-
Enables deno_resolver
Dependencies for the node feature
- node_resolver node_experimental?
- deno_runtime node_experimental?
- deno_terminal console?
- deno_semver node_experimental?
-
Enables deno_semver ^0.5.16
- deno_napi node_experimental?
- deno_npm node_experimental?
- checksum node_experimental?