Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
browserify v2 plugin for coffee-script with support for mixed .js and .coffee files
The coffeeify npm package is a Browserify transform for CoffeeScript. It allows you to require CoffeeScript files in your Browserify bundle, enabling seamless integration of CoffeeScript into your JavaScript projects.
Transform CoffeeScript to JavaScript
This feature allows you to transform CoffeeScript files into JavaScript using Browserify. The code sample demonstrates how to bundle a CoffeeScript file (`main.coffee`) into a JavaScript file (`bundle.js`) using the coffeeify transform.
const browserify = require('browserify');
const fs = require('fs');
browserify({
entries: ['main.coffee'],
transform: ['coffeeify']
})
.bundle()
.pipe(fs.createWriteStream('bundle.js'));
Integration with Browserify
This feature shows how to integrate coffeeify with Browserify directly. The code sample demonstrates how to bundle a CoffeeScript file (`app.coffee`) into a JavaScript file (`app.bundle.js`) by specifying the `.coffee` extension and using the coffeeify transform.
const browserify = require('browserify');
const coffeeify = require('coffeeify');
const fs = require('fs');
browserify({
entries: ['app.coffee'],
extensions: ['.coffee']
})
.transform(coffeeify)
.bundle()
.pipe(fs.createWriteStream('app.bundle.js'));
The `coffeescript` package is the official CoffeeScript compiler. It can be used to compile CoffeeScript files into JavaScript. Unlike coffeeify, which is a Browserify transform, `coffeescript` is a standalone compiler that can be used in various build processes.
The `gulp-coffee` package is a Gulp plugin for compiling CoffeeScript files. It integrates with the Gulp build system, allowing you to include CoffeeScript compilation in your Gulp tasks. This is different from coffeeify, which is specifically designed for use with Browserify.
The `grunt-contrib-coffee` package is a Grunt plugin for compiling CoffeeScript files. It integrates with the Grunt build system, enabling you to add CoffeeScript compilation to your Grunt tasks. This package is similar to gulp-coffee but is designed for use with Grunt instead of Gulp.
browserify v2 plugin for coffee-script
mix and match .coffee
and .js
files in the same project
given some files written in a mix of js
and coffee
:
foo.coffee:
console.log(require './bar.js')
bar.js:
module.exports = require('./baz.coffee')(5)
baz.coffee:
module.exports = (n) -> n * 111
install coffeeify into your app:
$ npm install coffeeify
when you compile your app, just pass -t coffeeify
to browserify:
$ browserify -t coffeeify foo.coffee > bundle.js
$ node bundle.js
555
you can omit the .coffee
extension from your requires if you add the extension to browserify's module extensions:
module.exports = require('./baz')(5)
$ browserify -t coffeeify --extension=".coffee" foo.coffee > bundle.js
$ node bundle.js
555
With npm do:
npm install coffeeify
MIT
FAQs
browserify plugin for coffeescript with support for mixed .js and .coffee files
We found that coffeeify demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.