v1.5.3
a simple yaml file reader, based only on deno standard libraries
Attributes
Includes Deno configuration
Repository
Current version released
11 months ago
Dependencies
std
@dallmo/util-yaml
overview
- a simple yaml file reader ;
- re-written in typescript, migrated from nodejs to base only on deno standard libraries ;
- published on both deno land and jsr ;
dependencies
all of deno standard library.
Deno.readTextFile- https://deno.land/std/yaml
usage
1. running on deno, import via deno module
nothing to add via CLI.
create 2 files :
test-via-deno-modules.ts;config.yaml; ( sample test files can be found insidetest/)
// this assumes the latest version
import { dallmo_util_yaml } from "https://deno.land/x/dallmo_util_yaml/mod.ts";
const config_file = "config.yaml";
const config_obj = await dallmo_util_yaml( config_file );
console.log( config_obj );- run the test file
deno run --allow-read test-via-deno-modules.ts2. running on deno, import via jsr
- in CLI, add the module with :
deno add @dallmo/util-yaml- create 2 files :
test-via-jsr.ts;config.yaml; ( sample test files can be found insidetest/)
import { dallmo_util_yaml } from "jsr:@dallmo/util-yaml";
const config_file = "config.yaml";
const config_obj = await dallmo_util_yaml( config_file );
console.log( config_obj );- run the test file
deno run --allow-read test-via-jsr.tsNOTE : 2025-06-11 updates
step 1 above is optional if the import is done via :
import { dallmo_util_yaml } from "jsr:@dallmo/util-yaml";or, if step 1 is performed, the import can be done via :
import { dallmo_util_yaml } from "@dallmo/util-yaml";but it seems it brings no harm if the import is done with the “jsr:” suffix, whether the module has been added via CLI or not. The test file test-via-jsr.ts has been therefore updated with that prefix, as well as the above sample code for simple copy-n-paste.
test
to run test codes :
- switch to the project root folder, i.e.
[root]/; - run deno task scripts :
- to test with dependencies via deno modules :
- run
deno task test-deno;
- run
- to test with dependencies via jsr :
- run
deno task test-jsr;
- run