How to use the yaml.default function in yaml

To help you get started, we’ve selected a few yaml examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github back4app / antframework / packages / ant / lib / config / Config.js View on Github external
/* eslint-disable no-console */

/**
 * @fileoverview Defines and exports the {@link Config} class.
 */

const assert = require('assert');
const path = require('path');
const fs = require('fs');
const yaml = require('yaml').default;
const Map = require('yaml/map').default;
const Pair = require('yaml/pair').default;
const Scalar = require('yaml/scalar').default;
const Seq = require('yaml/seq').default;
const { AntError, logger } = require('@back4app/ant-util');
const BinFunction = require('../functions/BinFunction');
const Runtime = require('../functions/runtimes/Runtime');
const LibFunction = require('../functions/LibFunction');
const Template = require('../templates/Template');
const Host = require('../hosts/Host');
const BasepathResolver = require('./handler/BasepathResolver');
const VariablesResolver = require('./handler/VariablesResolver');
const FunctionsPathResolver = require('./handler/FunctionsPathResolver');
const RuntimesPathResolver = require('./handler/RuntimesPathResolver');
const TemplatesPathResolver = require('./handler/TemplatesPathResolver');
const PluginsPathResolver = require('./handler/PluginsPathResolver');
github back4app / antframework / packages / ant / spec / lib / config / Config.spec.js View on Github external
/* eslint-disable no-console */

/**
 * @fileoverview Tests for lib/config/Config.js file.
 */

const { AssertionError } = require('assert');
const process = require('process');
const fs = require('fs');
const path = require('path');
const fsExtra = require('fs-extra');
const yaml = require('yaml').default;
const Map = require('yaml/map').default;
const Pair = require('yaml/pair').default;
const Scalar = require('yaml/scalar').default;
const Seq = require('yaml/seq').default;
const { AntError } = require('@back4app/ant-util');
const {
  Config,
  Ant,
  BinFunction,
  Runtime,
  LibFunction
} = require('../../../');

const utilPath = path.resolve(
  __dirname,
  '../../../node_modules/@back4app/ant-util-tests'
github back4app / antframework / plugins / ant-core / spec / lib / Core.spec.js View on Github external
/* eslint-disable no-console */

/**
 * @fileoverview Tests for lib/Core.js file.
 */

const path = require('path');
const fs = require('fs-extra');
const yaml = require('yaml').default;
const { makeExecutableSchema } = require('graphql-tools');
const { yargsHelper } = require('@back4app/ant-util-yargs');
const {
  Config,
  Ant,
  AntFunction,
  BinFunction,
  Runtime,
  LibFunction,
  Provider,
  Host,
  Template,
  Plugin
} = require('@back4app/ant');
const { AntCli } = require('@back4app/ant-cli');
const Core = require('../../lib/Core');
github lmammino / loige.co / import.js View on Github external
#!/usr/bin/env node

const { createReadStream, createWriteStream, promises } = require('fs')
const { readdir, readFile, writeFile } = promises
const { join, basename, dirname } = require('path')
const frontmatter = require('front-matter')
const mkdirp = require('mkdirp-promise')
const YAML = require('yaml').default

// get all md files in src
const getPosts = async (src) => {
  const all = await readdir(src)
  const md = all
    .filter((name) => name.match(/\.md$/))
    .map((name) => join(src, name) )
  return md
}

const expandWithContent = async (posts) => {
  const expandedPosts = await Promise.all(
    posts.map(
      (path) => new Promise((resolve, reject) => {
        readFile(path, 'utf8')
          .then((content) => resolve({ path, ...frontmatter(content) }))
github back4app / antframework / packages / ant / spec / lib / Ant.spec.js View on Github external
/**
 * @fileoverview Tests for lib/Ant.js file.
 */

const fs = require('fs');
const yaml = require('yaml').default;
const Core = require('@back4app/ant-core');
const GraphQL = require('@back4app/ant-graphql');
const Serverless = require('@back4app/ant-serverless');
const Ant = require('../../lib/Ant');
const Runtime = require('../../lib/functions/runtimes/Runtime');
const RuntimeController = require(
  '../../lib/functions/runtimes/RuntimeController'
);
const FunctionController = require('../../lib/functions/FunctionController');
const TemplateController = require('../../lib/templates/TemplateController');
const Plugin = require('../../lib/plugins/Plugin');
const PluginController = require('../../lib/plugins/PluginController');

describe('lib/Ant.js', () => {
  test('should export "Ant" class', () => {
    const ant = new Ant();
github segmentio / analytics-react-native / packages / integrations / src / integration-list.js View on Github external
const { parse } = require('yaml').default
const { readFileSync } = require('fs')
const { resolve } = require('path')

module.exports = parse(
	readFileSync(resolve(__dirname, '../integrations.yml'), 'utf-8')
)
	.map(({ name, ios = {}, android = {} }) => {
		if (ios.disabled && android.disabled) {
			return null
		}

		const slug = (sep = '') => name.replace(/-|_| /g, sep)
		const suffix = ios.disabled ? '-android' : android.disabled ? '-ios' : ''

		return {
			name,
github the-couch / slater-cli / index.js View on Github external
#! /usr/bin/env node
'use strict'

const pkg = require('./package.json')
const path = require('path')
const fs = require('fs-extra')
const themekit = require('@slater/themekit')
const queue = require('function-rate-limit')
const c = require('ansi-colors')
const bili = require('bili')
const postcss = require('rollup-plugin-postcss')
const chokidar = require('chokidar')
const mm = require('micromatch')
const yaml = require('yaml').default
const onExit = require('exit-hook')
const exit = require('exit')
const spaghetti = require('@friendsof/spaghetti')
const { socket, closeServer } = require('./lib/socket.js')
const bundler = require('./lib/bundler.js')
const { log, join, resolve } = require('./lib/util.js')

log(c.gray(`v${pkg.version}`))

const {
  _: args,
  config: configFile = 'slater.config.js',
  env = 'development',
  debug,
  ...props
} = require('minimist')(process.argv.slice(2))