How to use the csso/package.json.version function in csso

To help you get started, we’ve selected a few csso 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 css / csso-cli / test / basic.js View on Github external
it('should output version', function() {
    return run('-v')
        .output(require('csso/package.json').version);
});
github css / csso-cli / index.js View on Github external
var timeDiff = process.hrtime(time);
            showStat(
                relInputFilename,
                source.length,
                result.css.length,
                sourceMap.inputFile,
                sourceMapAnnotation.length,
                parseInt(timeDiff[0] * 1e3 + timeDiff[1] / 1e6, 10),
                process.memoryUsage().heapUsed - mem
            );
        }
    });
}

var command = cli.create('csso', '[input]')
    .version(require('csso/package.json').version)
    .option('-i, --input ', 'Input file')
    .option('-o, --output ', 'Output file (result outputs to stdout if not set)')
    .option('-s, --source-map ', 'Generate source map: none (default), inline, file or ', 'none')
    .option('-u, --usage ', 'Usage data file')
    .option('--input-source-map <source>', 'Input source map: none, auto (default) or ', 'auto')
    .option('-d, --declaration-list', 'Treat input as a declaration list')
    .option('--no-restructure', 'Disable structural optimisations')
    .option('--force-media-merge', 'Enable unsafe merge of @media rules')
    .option('--comments ', 'Comments to keep: exclamation (default), first-exclamation or none', 'exclamation')
    .option('--stat', 'Output statistics in stderr')
    .option('--debug [level]', 'Output intermediate state of CSS during a compression', debugLevel, 0)
    .option('--watch', 'Watch source file for changes')
    .action(function(args) {
        var options = processOptions(this.values, args);

        if (options === null) {

csso

CSS minifier with structural optimisations

MIT
Latest version published 2 years ago

Package Health Score

76 / 100
Full package analysis