Socket
Socket
Sign inDemoInstall

stylecow-core

Package Overview
Dependencies
3
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    stylecow-core

Stylecow core library


Version published
Weekly downloads
9
increased by200%
Maintainers
1
Install size
12.4 MB
Created
Weekly downloads
 

Readme

Source

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);

Keywords

FAQs

Last updated on 02 Aug 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc