Socket
Socket
Sign inDemoInstall

js-yaml-import

Package Overview
Dependencies
5
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    js-yaml-import

Allows import files in YAML.


Version published
Maintainers
1
Install size
2.07 MB
Created

Readme

Source

js-yaml-import Build Status Coverage Status

Allows import files in YAML.

Requirements

This plugin requires an LTS Node version (v10.0.0+).

Install

Using npm:

$ npm i js-yaml js-yaml-import -D

Using yarn:

$ yarn add js-yaml js-yaml-import -D

Usage

# ./src/foo.yaml

Media:
  Anime: foo
# ./src/bar.yaml

'@import':
  - baz.yaml

Media:
  VideoGames: bar
# ./src/baz.yaml

Media:
  FilmAdaptation: baz
# ./src/data.yaml

'@import':
  - foo.yaml
  - bar.yaml

Media:
  Webcomic: aaa
  Manga: bbb
const path = require('path');
const Yaml = require('js-yaml-import');

const yaml = new Yaml(path.join(__dirname, 'src'));
const yamlFile = yaml.read(path.join(__dirname, './src/data.yaml'));

console.log('data =', yamlFile);
// data = {
//   Media: {
//     Anime: 'foo',
//     FilmAdaptation: 'baz',
//     VideoGames: 'bar',
//     Webcomic: 'aaa',
//     Manga: 'bbb'
//   }
// }

Options

searchPaths

Type: string | string[]

Example

Keywords

FAQs

Last updated on 04 Jan 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc