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

esm-yaml-loader

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esm-yaml-loader

YAML loader for webpack (converts YAML to JSON)

  • 0.5.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

esm-yaml-loader for webpack

ES Module YAML loader for webpack. Converts YAML to an ES Module. This is a fork of yaml-loader.

Installation

npm install esm-yaml-loader

Usage

Documentation: Using loaders

Simplest case would be:

// Import tree shakeable identifiers from yaml
import * as obj from 'esm-yaml-loader!./file.yml'
// or the default export for variable identifiers that aren't valid ES6
import obj from 'esm-yaml-loader!./file.yml'

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

// webpack.config.js
module: {
  loaders: [
    {
      test: /\.ya?ml$/,
      loader: 'esm-yaml-loader',
    },
  ],
}

and then

// application.js
import(`./../data/${file}.yaml`).then(res => {
  // ...
})

License

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

Keywords

FAQs

Package last updated on 24 Jun 2019

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