Git Product home page Git Product logo

yaml_loader's Introduction

yaml_loader

Yaml Loader is a Deno module that allows you to load yaml files and parse their contents as json.

Features

Yaml Loader will parse your json files using the deno standard library, therefore, there aren't any third-party modules used.

Usage

Before using yaml_loader, you must first have Deno installed. If you don't, go to the Deno Installation page and follow those simple steps :)

All right, nown that we got that stuff over, you can just use the yaml_loader module in your project by add this simple line of code:

import { YamlLoader } from "https://deno.land/x/yaml_loader/mod.ts";

After that, we can start utilizing the YamlLoader class! The only method inside of the class that you need is parseFile. It is an asynchronous method, though, so remember to always await for it to be done ;) Here is an example of using the YamlLoader:

There is a breaking change when updating from v0.0.0 to v0.1.0 The parseYamlFile method on YamlLoader is now named parseFile

import { YamlLoader } from "https://deno.land/x/yaml_loader/mod.ts";

const yamlLoader = new YamlLoader();

const parsedYamlFile = await yamlLoader.parseFile("./foo.yaml");

console.log(parsedYamlFile);

The above code would parse the foo.yaml file and set its json-ified contents to the parsedYamlFile constant. After that, we are just logging out the data as an object from foo.yaml after it is parsed.

yaml_loader's People

Contributors

sno2 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.