Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

yaml-loader

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yaml-loader

YAML loader for webpack (converts YAML to JSON)

  • 0.4.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
330K
increased by53.61%
Maintainers
1
Weekly downloads
 
Created
Source

yaml-loader for webpack

YAML loader for webpack. Converts YAML to a valid JSON. If you want a JS Object, chain it with json-loader.

Installation

npm install yaml-loader

Usage

Documentation: Using loaders

Simplest case would be:

var json = require("json!yaml!./file.yml");
// => returns file.yml as javascript object

This loader is also useful for getting a valid JSON from YML. For example:

// webpack.config.js
module: {
  loaders: [
    {
      test: /\.yaml$/,
      include: path.resolve('data'),
      loader: 'yaml',
    },
  ],
}

and then

// applicatin.js
const actualFilename = require(`file?name=[name].json!./../data/${file}.yaml`);
window.fetch(actualFilename).then(res => {
  // ...
});

License

MIT (http://www.opensource.org/licenses/mit-license.php)

Keywords

FAQs

Package last updated on 22 Jul 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc