How to use the yamljs.dump function in yamljs

To help you get started, we’ve selected a few yamljs 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 netlify / netlify-cms / website / gulpfile.babel.js View on Github external
new Promise((resolve, reject) => {
            const contributors = JSON.parse(content).contributors.map(c => {
              const avatar = url.parse(c['avatar_url'], true);
              avatar.search = undefined; // Override so that we can use `avatar.query`.
              if (avatar.hostname.endsWith('githubusercontent.com')) {
                // Use 32px avatars, instead of full-size.
                avatar.query['s'] = '32';
              }
              const avatar_url = url.format(avatar);
              return Object.assign({}, c, { avatar_url });
            });
            resolve(yaml.dump({ contributors }));
          })
      )
github mathisonian / swaggerize / lib / utils.js View on Github external
get: function(yaml) {
                yaml = yaml || false;
                if (validate()) {
                    return (yaml ? YAML.dump(spec,100,2): JSON.stringify(spec, null, 2));
                } else {
                    console.error('Errors found when validating generated Swagger');
                    return false;
                }
            }
        };

yamljs

Standalone JavaScript YAML 1.2 Parser & Encoder. Works under node.js and all major browsers. Also brings command line YAML/JSON conversion tools.

MIT
Latest version published 7 years ago

Package Health Score

64 / 100
Full package analysis