Download api/utils/loadYaml.js from Zhitomir/chat: direct link, hf CLI and curl.
- Browser
- Download file 256 Bytes
-
https://huggingface.co/spaces/Zhitomir/chat/resolve/main/api/utils/loadYaml.js
- Command line
-
hf download hf://spaces/Zhitomir/chat/api/utils/loadYaml.js
-
curl -L -o loadYaml.js https://huggingface.co/spaces/Zhitomir/chat/resolve/main/api/utils/loadYaml.js
256 Bytes
| const fs = require('fs'); | |
| const yaml = require('js-yaml'); | |
| function loadYaml(filepath) { | |
| try { | |
| let fileContents = fs.readFileSync(filepath, 'utf8'); | |
| return yaml.load(fileContents); | |
| } catch (e) { | |
| return e; | |
| } | |
| } | |
| module.exports = loadYaml; | |