Benign rust 79 installs Download

ferrijs-cli 0.4.0

“Run a JavaScript or TypeScript program in a ferrijs realm from the command line, granting exactly what it may reach.”

imports std::process::ExitCodeReads a file into a Rust string
SHA-2567cfddfad0219a6beca6e6d1f614506299df85854b808f24b8b97bdacea38f365
MaleculeH₂(F₂Os)

Evidence

imports std::process::ExitCode lines 1–16
1//! `ferrijs run <file>` and `ferrijs eval <source>`: a realm from the
2//! command line, granting exactly what the flags say.
3
4use std::path::PathBuf;
5use std::process::ExitCode;
6use std::sync::Arc;
7use std::time::Duration;
8
9use clap::{Args, Parser, Subcommand};
10use ferrijs::{
11 ConsoleEntry, ConsoleLevel, ConsoleSink, Limits, ModulePolicy, Permissions, RealmOptions, RunOptions, Runtime,
12};
13use ferrijs_bundle::{Bundler, BundlerOptions, BytecodeCache};
14
15/// The engine already runs on mimalloc; putting the host side on it too
16/// means the bundler, the source m …
Reads a file into a Rust string lines 226–229
226:5… t rt = grants.runtime(root.clone()).await?;
227 let source = std::fs::read_to_string(&file).map_err(|e| format!("{}: {e}", file.display()))?;
228 let args = parse_args(&args);
229 let needs_bundle = ferrijs_bundle::is …
Reads a Rust environment variable lines 275–282
275:30… hese stamps measure only what happens after
276/// that, which is the part this binary can do anything about.
277fn main() -> ExitCode {
278 let t = std::time::Instant::now();
279 let trace = std::env::var_os("FERRIJS_STARTUP_TRACE").is_some();
280 let stamp = move |what: &str| {
281 if trace {
282 eprintln!(" {:>8.3} ms {what}", t.e …
References the Tokio async runtime namespace lines 288–293
288:15… whose fault it was.
289 #[allow(clippy::expect_used)]
290 let rt = tokio::runtime::Runtime::new().expect("tokio runtime");
291 stamp("tokio runtime built");
292 let code = rt.block_on(async_main(&stamp));
293 …
Rust reads current directory lines 305–310
305:3… let outcome = match cli.command {
306 Command::Run { file, args, grants } => run_file(file, args, grants).await,
307 Command::Eval { source, grants } => match grants.runtime(std::env::current_dir().unwrap_or_default()).await {
308 Ok(rt) => {
309 stamp("realm built");
310 let r = rt.eval_script(&source, &[], RunO …

No evidence locations were recorded for this file. Raw result

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.