es-css2js

0.0.15 • Public • Published

CSS2JS - Build Standalone UI Modules

CSS2JS could help you build standalone UI modules without referencing addtional CSS file. You can compile your CSS to a normal JavaScript file, a RequireJS module, an AngularJS module or any other custom JavaScript module.

Install

npm install es-css2js -g

Example usage

From command-line:

css2js srouce1.css source2.css source3.css ... sourceN.css dest.js

The file path will be related to your current executing path.

From node

#!/usr/bin/env node

var css2js = require('es-css2js');  
css2js({
  path: "/basepath",  //base path of source file and destination file, defaults to "/"
  src:  ["a.css", "b.css"], //source file
  dest: "dest.js" // destination file,
  wrapper: "requirejs" // Your module wrapper. Defaults to a function closure. It also cloud be a function like the following sample:
});

function customWrapper(content){
	return "hello!!![" + content + "]hello!!!";
}

Package Sidebar

Install

npm i es-css2js

Weekly Downloads

20

Version

0.0.15

License

MIT

Last publish

Collaborators

  • errorstack