How to use the js-beautify.css_beautify function in js-beautify

To help you get started, we’ve selected a few js-beautify 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 petrosagg / papagal / tools / beautify.js View on Github external
writeModule(pathModule.join(dirPath, foo), modules[id-1], level + 1)
			}
		}
	}
}

writeModule('./index', main)
for (const module of Object.keys(npmPackages)) {
	console.log(module)
}

console.log('Beautifying CSS')

const cssSource = fs.readFileSync('./raw/owl-6b62c5e3a6e6dcb3b0e634d33810efdb.css', 'utf8')

fs.writeFileSync('./src/css/style.css', css_beautify(cssSource, { indent_size: 4 }) + '\n')
github jdf2e / jdf / lib / fileFormat.js View on Github external
function cssFormat(filename){
	var content = f.read(filename);

	f.write(filename, beautify.css_beautify(content));
	logger.info('jdf format ['+filename+'] success');
}
github nkashyap / console.io / server / utils.js View on Github external
getContent: function getContent(content, type) {
        switch (type) {
            case 'css':
                content = beautify.css_beautify(content, {
                    "indent_size": 4,
                    "indent_char": " "
                });
                break;
            case 'js':
                content = beautify.js_beautify(content, {
                    "indent_size": 4,
                    "indent_char": " ",
                    "indent_level": 0,
                    "indent_with_tabs": false,
                    "preserve_newlines": true,
                    "max_preserve_newlines": 5,
                    "jslint_happy": false,
                    "brace_style": "collapse",
                    "keep_array_indentation": false,
                    "keep_function_indentation": false,
github AshKyd / alchemize / src / scripts / worker.js View on Github external
prettify: function(opts, cb) {
      var pretty = beautify.css_beautify(opts.input, opts);
      cb({
        output: pretty
      });
    }
  },
github codice / ddf / ui / packages / catalog-ui-search / src / main / webapp / dev / component / base-guide / base-guide.view.js View on Github external
this.$el.find('.editor[data-css]').each((index, element) => {
      const instanceCSS = this.styles[element.getAttribute('data-css')]
      renderAce({
        where: element,
        mode: 'less',
        value: beautify.css_beautify(instanceCSS),
        view: this,
      })
    })
    this.$el.find('.editor[data-js]').each((index, element) => {
github thingsboard / thingsboard / ui-ngx / src / app / modules / home / pages / widget / widget-editor.component.ts View on Github external
beautifyCss(): void {
    const res = css_beautify(this.widget.templateCss, {indent_size: 4});
    if (this.widget.templateCss !== res) {
      this.isDirty = true;
      this.widget.templateCss = res;
      this.cssEditor.setValue(this.widget.templateCss ? this.widget.templateCss : '', -1);
    }
  }