Skip to content
This repository was archived by the owner on May 10, 2023. It is now read-only.
/ webassets Public archive

A webservice to compile and compress various web assets

License

Notifications You must be signed in to change notification settings

lithammer/webassets

Repository files navigation

Webassets

A webservice to compile and compress various web assets, e.g. LESS, JavaScript, CoffeeScript etc.

Build Status

Usage

Some LESS code in a file.

$ cat style.less
@color-red: red;
@color-green: green;

a {
  color: @color-red;

  .green {
    color: @color-green;
  }
}

Simply do a POST request with Content-Type: text/less to compile LESS to regular CSS.

$ curl -X POST --data-binary @style.less -H "Content-Type: text/less" http://webassets.herokuapp.com/api/
a {
  color: #ff0000;
}
a .green {
  color: #008000;
}

Want it compressed as well? Add the compress=true query parameter.

$ curl -X POST --data-binary @style.less -H "Content-Type: text/less" http://webassets.herokuapp.com/api/?compress=true
a{color:#ff0000;}a .green{color:#008000;}

Supported content-types

Content-type Header
CSS text/css
LESS text/less
Stylus text/stylus
JavaScript text/javascript
CoffeeScript text/coffeescript

Test

$ npm install
$ npm test

About

A webservice to compile and compress various web assets

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •