Cargo Features
[dependencies]
rustyscript = { version = "0.11.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"] }
- 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
… - 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_telemetry, deno_tls, deno_web, fs_import, hyper-util, url, url_import, webidl
-
Timers, events, text encoder/decoder, telemetry 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?
-
Enables deno_permissions ^0.40.0
- deno_broadcast_channel broadcast_channel?
-
Enables deno_broadcast_channel ^0.174.0
Dependencies for the various extension features
- deno_cache cache?
-
Enables deno_cache ^0.112.0
- deno_console console?
-
Enables deno_console ^0.180.0
- deno_cron cron?
-
Enables deno_cron ^0.60.0
- deno_crypto crypto?
-
Enables deno_crypto ^0.194.0
- deno_fetch web?
-
Enables deno_fetch ^0.204.0
- deno_ffi ffi?
-
Enables deno_ffi ^0.167.0
- deno_fs fs?
-
Enables deno_fs ^0.90.0
- deno_http http?
-
Enables deno_http ^0.178.0
- deno_kv kv?
-
Enables deno_kv ^0.88.0
- deno_net web?
-
Enables deno_net ^0.172.0
- deno_node node_experimental?
-
Enables deno_node ^0.117.0
- deno_telemetry web?
-
Enables deno_telemetry ^0.2.0
- deno_tls web?
-
Enables deno_tls ^0.167.0
- deno_url url?
-
Enables deno_url ^0.180.0
- deno_web web?
-
Enables deno_web ^0.211.0
- deno_webidl webidl?
-
Enables deno_webidl ^0.180.0
- deno_webstorage webstorage?
-
Enables deno_webstorage ^0.175.0
- deno_websocket websocket?
-
Enables deno_websocket ^0.185.0
- deno_webgpu webgpu?
-
Enables deno_webgpu ^0.147.0
- deno_io io?
-
Enables deno_io ^0.90.0
- 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 ^0.12.0
Dependencies for the node feature
- node_resolver node_experimental?
-
Enables node_resolver ^0.19.0
- deno_runtime node_experimental?
-
Enables deno_runtime ^0.189.0
- deno_terminal console?
- deno_semver node_experimental?
-
Enables deno_semver ^0.5.16
- deno_napi node_experimental?
-
Enables deno_napi ^0.111.0
- deno_npm node_experimental?
- checksum node_experimental?