[package] name = "rustyscript" description = "Effortless JS Integration for Rust" edition = "2021" license = "MIT OR Apache-2.0" version = "0.9.0" repository = "https://github.com/rscarson/rustyscript" keywords = ["rust", "javascript", "deno", "runtime", "embedding"] categories = ["web-programming", "network-programming", "api-bindings", "compilers", "development-tools::ffi"] readme = "readme.md" [features] default = ["worker", "web_stub", "console", "url", "crypto"] no_extensions = [] all = ["web", "io", "webstorage", "cache", "websocket"] # 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 filesystem # # It 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 # And for the sake of those googling it: # `setTimeout is not enabled in this environment` is happening because neither this feature nor the web feature are enabled web_stub = ["webidl", "base64-simd"] # # 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 # # [https://w3c.github.io/ServiceWorker/#cache-interface] cache = ["deno_cache", "webidl", "web"] # [https://console.spec.whatwg.org/] console = ["deno_console"] # [https://www.w3.org/TR/WebCryptoAPI/] crypto = ["deno_crypto", "webidl"] # Provides IO primitives for other Deno extensions (stdio streams, etc) io = ["deno_io", "web", "rustyline", "winapi", "nix", "libc", "once_cell"] # [https://url.spec.whatwg.org/] # [https://wicg.github.io/urlpattern/] url = ["deno_url", "webidl"] # Timers, events, text encoder/decoder, # [https://w3c.github.io/FileAPI] # [https://fetch.spec.whatwg.org/] web = ["deno_web", "webidl", "deno_tls", "deno_fetch", "deno_net", "console", "url", "crypto", "url_import", "fs_import", "http"] # [https://webidl.spec.whatwg.org/] webidl = ["deno_webidl"] # [https://html.spec.whatwg.org/multipage/webstorage.html] webstorage = ["deno_webstorage", "webidl"] # [https://websockets.spec.whatwg.org/] websocket = ["deno_websocket", "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 fs_import = [] url_import = ["reqwest"] # Enables the use of the SnapshotBuilder runtime # It is used to create a snapshot of a runtime for faster startup times snapshot_builder = [] # Enables the threaded worker API worker = [] # # End of feature definitions # [dependencies] thiserror = "1.0.65" serde = "1.0.214" # Used to generate identifiers for callbacks paste = "1.0.15" # The deno runtime itself, and the webidl extension for the web APIs deno_core = "0.314.2" # For transpiling typescript deno_ast = { version = "0.43.3", features = ["transpiling"]} # Runtime for async tasks tokio = "=1.41.0" tokio-util = "0.7.12" # For URL imports # Pinned for now due to upstream issues reqwest = { version = "=0.12.8", optional = true, default-features = false, features = ["blocking", "rustls-tls"] } http = { version = "1.1.0", optional = true } # # Dependencies for the various extension features # deno_cache = {version = "0.107.0", optional = true} deno_console = {version = "0.175.0", optional = true} deno_crypto = {version = "0.189.0", optional = true} deno_fetch = {version = "0.199.0", optional = true} deno_net = {version = "0.167.0", optional = true} deno_tls = {version = "0.162.0", optional = true} # Options for the web feature deno_url = {version = "0.175.0", optional = true} deno_web = {version = "0.206.0", optional = true} deno_webidl = {version = "0.175.0", optional = true} deno_webstorage = {version = "0.170.0", optional = true} deno_websocket = {version = "0.180.0", optional = true } deno_io = {version = "0.85.0", optional = true} # Dependencies for the IO feature rustyline = {version = "=14.0.0", optional = true} winapi = {version = "=0.3.9", optional = true, features = [ "commapi", "knownfolders", "mswsock", "objbase", "psapi", "shlobj", "tlhelp32", "winbase", "winerror", "winuser", "winsock2", "processenv", "wincon", "wincontypes", "consoleapi" ]} nix = {version = "=0.29.0", optional = true, features = ["term"]} libc = {version = "0.2.161", optional = true} once_cell = {version = "1.20.2", optional = true} # Dependencies for the web stub feature base64-simd = {version = "0.8.0", optional = true} [dev-dependencies] version-sync = "0.9.5" criterion = "0.5.1" [[example]] name = "custom_threaded_worker" required-features = ["worker"] [[example]] name = "default_threaded_worker" required-features = ["worker"] [[example]] name = "worker_pool" required-features = ["worker"] [[example]] name = "create_snapshot" required-features = ["snapshot_builder"] [[example]] name = "url_import" required-features = ["fs_import", "url_import"] [[example]] name = "custom_import_logic" required-features = ["url_import"] [[example]] name = "async_javascript" required-features = ["web_stub"] [[example]] name = "websocket" required-features = ["websocket", "web"] [[bench]] name = "runtime" harness = false