const asYAML = (data, file) => { const name = fileName(file); fs.writeFileSync(join(ldir, `${name}.yaml`), yaml.dump(data)); }
const serializeObject = function(object) { return dump(object, { schema: JSON_SCHEMA, noRefs: true, sortKeys: true, lineWidth: Infinity }).trimRight() }
/** * Serializes the given API as YAML, using the given spaces for formatting. * * @param {object} api API to convert to YAML * @param {string|number} spaces number of spaces to ident * @param {number} wrap the column to word-wrap at */ function toYAML (api, spaces, wrap) { const jsYaml = require("js-yaml"); return jsYaml.dump(api, { indent: spaces, lineWidth: wrap, noRefs: true }); }
worker.send({ type: 'config', body: yaml.dump(config) });