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.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

js-yaml-import Build Status Coverage Status

Allows import files in YAML.

Requirements

This plugin requires an LTS Node version (v8.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:
  video_games: foo
# ./src/bar.yaml

media:
  film_adaptation: bar
# ./src/data.yaml

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

media:
  webcomic: aaa
  manga: bbb
  anime: ccc
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: {
//     video_games: 'foo',
//     film_adaptation: 'bar',
//     webcomic: 'aaa',
//     manga: 'bbb',
//     anime: 'ccc'
//   }
// }

Options

searchPaths

Type: string | string[]

Example

Keywords

FAQs

Package last updated on 26 Nov 2020

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