v1.5.2
a simple yaml file reader, based only on deno standard libraries
Attributes
Includes Deno configuration
Repository
Current version released
8 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.ts
2. 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 "@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.ts
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