Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
frosting
Advanced tools
Readme
Task helpers for Cakefiles
I've always been a little frustrated with the node filesystem API, especially when trying to get a build process in place for a javascript project. Frosting is really not much more than an abstraction layer over the filesystem module that helps keep Cakefiles readable.
To skip right to some code, here's an example Cakefile with build tasks for a client-side javascript library:
{each} = require 'frosting'
task 'compile:dev', 'Compile development distro files', ->
each './lib/*.coffee', ( f ) -> f.compile -> f.write "./dist/dev/#{f.basename( )}.js"
task 'compile:min', 'Compile minified distro files', ->
each './lib/*.coffee', ( f ) -> f.compile -> f.minify -> f.write "./dist/min/#{f.basename( )}.js"
task 'compile', 'Compile all distro files', ->
invoke 'compile:dev'
invoke 'compile:min'
Frosting is definitely an opinionated set of build tools. It assumes that source files are being written in coffeescript and minification will be done via uglify-js.
Frosting provides a couple of convenience methods that yield a File
class.
This class has the necessary API for reading, writing, mutating, inspecting,
compiling and minifying source files.
each
each
can be used to iterate over a set of source files. It accepts a callback
which will be passed a File
instance for each file, and you can build as you wish
from there. It can be given a glob pattern or an explicit array of files.
each './lib/*.coffee', ( f ) -> # `f` is an instance of File
# or
each [
'./lib/foo.coffee',
'./lib/bar.coffee',
'./lib/baz.coffee'
], ( f ) -> # `f` is an instance of File
concat
concat
is similar to each, except it simply concatenates all of the source
files into one coffeescript file and yields a File
instance with the combined
sources already in the buffer. If given an array of filenames, they will be
read and concat'd in order.
concat './lib/*.coffee', ( f ) -> # `f` is an instance of File, will only get called once
# or
concat [
'./lib/foo.coffee',
'./lib/bar.coffee',
'./lib/baz.coffee'
], ( f ) -> # `f` is an instance of File, will only get called once
TODO describe the File
API
FAQs
Task helpers for Cakefiles
The npm package frosting receives a total of 16 weekly downloads. As such, frosting popularity was classified as not popular.
We found that frosting 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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.