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

js-yaml-import

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-yaml-import

Allows import files in YAML.

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
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

Package last updated on 04 Jan 2021

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