mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
Chore/version 0 3 1 0 (#1475)
* feat: move over to workspaces * chore: Move to libs * chore:fix(build): Compat * chore: fixing pr
This commit is contained in:
11
libs/snapshot-creator/Cargo.toml
Normal file
11
libs/snapshot-creator/Cargo.toml
Normal file
@@ -0,0 +1,11 @@
|
||||
[package]
|
||||
name = "snapshot-creator"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
dashmap = "5.1.0"
|
||||
deno_core = "0.136.0"
|
||||
deno_ast = {version="0.15.0", features = ["transpiling"]}
|
||||
14
libs/snapshot-creator/src/main.rs
Normal file
14
libs/snapshot-creator/src/main.rs
Normal file
@@ -0,0 +1,14 @@
|
||||
use deno_core::{JsRuntime, RuntimeOptions};
|
||||
|
||||
fn main() {
|
||||
let mut runtime = JsRuntime::new(RuntimeOptions {
|
||||
will_snapshot: true,
|
||||
..Default::default()
|
||||
});
|
||||
let snapshot = runtime.snapshot();
|
||||
|
||||
let snapshot_slice: &[u8] = &*snapshot;
|
||||
println!("Snapshot size: {}", snapshot_slice.len());
|
||||
|
||||
std::fs::write("JS_SNAPSHOT.bin", snapshot_slice).unwrap();
|
||||
}
|
||||
Reference in New Issue
Block a user