
Security News
PodRocket Podcast: Inside the Recent npm Supply Chain Attacks
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Builds, bundles, and minifies CSS and CoffeeScript files.
== Building CSS
require 'css-reader' css = CSSReader.new("test.css","secondary.css") css.save("production.css", :compress => true)
The above commands will generate new file that merges the files passed to the class in order. Also, and "@import" statement is processed inline and is also inserted in the order it is encountered recursively throughout the CSS. In this example the file has also been yui-compressed.
Alternatively, you can pass in additional css files at later point with the append method:
css = CSSReader.new("test.css")
do stuff...
css.append("secondary.css")
You could also run this from the command line:
buildcss public/stylesheets/main.css -c
Which will recursively process all imported files and then write a single minified CSS file to: public/stylesheets/main.build.min.css
== Building CoffeeScript
require 'coffee-bundler' js = CoffeeBundler.new("path/to/coffee/bundle") js.save("public/javascripts/bundle.min.js", :compress => true)
This will effectively bundle files that match: path/to/coffee/bundle/*.coffee
...into a single minified JS file located at: public/javascripts/bundle.min.js
No, this will not work unless you have coffee-script installed on your system!
== Dependencies
Requires the yui-compressor gem:
gem install -r yui-compressor
More info: http://github.com/sstephenson/ruby-yui-compressor
== Specs
A simple but comprehensive rSpec suite is provided for quality assurance purposes.
spec css_reader_spec.rb
== Disclaimer
This is really crude but useful. You could easily crash it if you placed an @import statement in a fashion to create an infinite loop. Don't do that! :)
FAQs
Unknown package
We found that assetbuild demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.