npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-cli-plugin-yaml-loader

v1.0.0

Published

Add support for YAML in your Webpack config.

Downloads

543

Readme

vue-cli-plugin-yaml-loader

Start to support YAML file within your Vue application in minutes

This is a vue-cli plugin to add support for YAML file, using yaml-loader and webpack.

⭐Features

  • Enable support for YAML file
  • Enable support for YAML file that includes multiple Yaml Document
  • Convert YAML to JSON

Install

This plugin can be installed from the Vue-CLI and does not require any configuration or settings.

Installation through the Vue UI:

  • Initialize the UI: vue ui
  • Access the plugin menu
  • Click Add Plugin on the top right or search for vue-cli-plugin-yaml-loader
  • Click Install vue-cli-plugin-yaml-loader
  • Follow the screen settings
  • Voila'... you are ready lo load Yaml in your project

Intallation through the CLI

  • Navigate to your project
  • type vue add vue-cli-plugin-yaml-loader
  • follow the CLI promps
  • Voila'... you are ready lo load Yaml in your project

USAGE

Just add a YAML file within your project. The Plugin offer two option. One to load simple YAML, and one to include multiple YAML documents.

Simple YAML

`

src/asset/sample.yaml

sampleKey: SampleValue `

Now just import them:

` //src/main.js

Simple Import

import myYamlObj from './asset/sample.yaml';

console.log(myYamlObj); //{ "sampleKey": "sampleValue"}

By Omitting extension

import myYamlObj from './asset/sample';

console.log(myYamlObj); //{ "sampleKey": "sampleValue"}

By destructuring the yaml (JSON) returned

import { sampleKey } from './asset/sample.yaml';

console.log(sampleKey); //"sampleValue"

`

Multiple YAML documents

A single YAML file can include MULTIPLE YAML document. This are usually defined by start of document separator "---". To use this feature you need to add a "stream" parameters, within the YAML import:

`

src/asset/multiDocument.yaml


title: Document one

title: Document two `

Now just import them using the stream flag: `

Multi Document import

import multiDocumentYaml from './asset/multiDocument.yaml?stream';

console.log(multiDocumentYaml); //[{ "title": "Document one"}, { "title": "Document Two"}] `