GithubHelp home page GithubHelp logo

isabella232 / rollup-plugin-yaml Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rollup/rollup-plugin-yaml

0.0 0.0 0.0 64 KB

This module has moved and is now available at @rollup/plugin-yaml / https://github.com/rollup/plugins

JavaScript 100.00%

rollup-plugin-yaml's Introduction

Moved

This module has moved and is now available at @rollup/plugin-yaml. Please update your dependencies. This repository is no longer maintained.

rollup-plugin-yaml

Convert .yaml and .yml files to ES6 modules:

// import a single property from a YAML file
import { foo } from './config.yaml';

// import the whole file as an object
import config from './config.yaml';

Installation

npm install --save-dev rollup-plugin-yaml

Usage

import { rollup } from 'rollup';
import yaml from 'rollup-plugin-yaml';

rollup({
  entry: 'main.js',
  plugins: [
    yaml({
      // All YAML files will be parsed by default,
      // but you can also specifically include/exclude files
      include: 'node_modules/**',  // Default: undefined
      exclude: [ 'node_modules/foo/**', 'node_modules/bar/**' ],  // Default: undefined
      // optionally mutate parsed yaml with a transform function.
      // The transform function may either:
      // - return an updated version of the yaml content
      // - return `undefined`, and mutate the yaml content directly
      transform(data) {
        if (Array.isArray(data))
          return data.filter((element) => !element.private);
      }
    })
  ]
});

License

MIT

rollup-plugin-yaml's People

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.