Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
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
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.