npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript.Learn more »

stylecow-core

2.5.0 • Public • Published

Stylecow core

Fast and furious css processor. For node >= v4.0

Build Status

Simple usage example:

"use strict";
 
let stylecow = require('stylecow-core');
 
//Create a Tasks instance and add some stuff
let tasks = (new stylecow.Tasks())
 
    //minimum browser support
    .minSupport({
        explorer: 9,
        firefox: 30,
        chrome: 30,
        safari: 6,
        ios: 6,
        opera: 12
    })
 
    //add some plugins
    .use(require('stylecow-plugin-prefixes'))
    .use(require('stylecow-plugin-nested-rules'))
    .use(require('stylecow-plugin-color'))
 
    //custom tasks
    .addTask({
        filter: {
            type: 'Keyword',
            name: 'grey'
        },
        fn: keyword => keyword.name = 'gray'
    });
 
//Create a Coder instance to minify the css code
let coder = new stylecow.Coder('minify');
 
//Parse a css file
let css = stylecow.parseFile('styles.css');
 
//Execute the tasks
tasks.run(css);
 
//Get the minified code
let code = coder.run(css);
 
console.log(code.css);

install

npm i stylecow-core

Downloadsweekly downloads

37

version

2.5.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability