3.0.1 • Published 4 years ago

coffeeify v3.0.1

Weekly downloads
380,791
License
MIT
Repository
github
Last release
4 years ago

coffeeify Build Status

CoffeeScript browserify transform. Mix and match .coffee and .js files in the same project.

NOTE: As of version 3.0.0 coffeeify requires CoffeeScript to be installed manually as a peerDependency, also note that the CoffeeScript package has changed name from coffee-script to coffeescript.

Example

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 ** n

Install coffeeify into your app, and CoffeeScript if you don't have it already:

$ npm install --save-dev coffeeify coffeescript

When you compile your app, just pass -t coffeeify to browserify:

$ browserify -t coffeeify foo.coffee > bundle.js
$ node bundle.js
3125

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
3125

You can also pass options to the CoffeeScript compiler:

$ browserify -t [ coffeeify --bare false --header true ] --extension=".coffee" foo.coffee
..
// Generated by CoffeeScript 1.10.0
(function() {
  console.log(require('./bar.js'));

}).call(this);
..

Options

NameDefaultDescription
sourceMapnullGenerate source maps, deteremined from browserify's --debug option if not set.
baretrueOmit the (function(){ .. }).call(this); wrapper.
headerfalseInclude the // Generated by CoffeeScript <version> header in every file processed.

When using browserify programatically options can be passed as an object, example:

browserify = require 'browserify'
coffeeify = require 'coffeeify'

bundle = browserify
  extensions: ['.coffee']

bundle.transform coffeeify,
  bare: false
  header: true

bundle.add 'foo.coffee'

bundle.bundle (error, result) ->
  throw error if error?
  process.stdout.write result

Install

With npm do:

npm install --save-dev coffeeify

CoffeeScript is not installed automatically, so that you can choose what version of CoffeeScript you'd like:

npm install --save-dev coffeescript  # Or coffeescript@1 to use CoffeeScript 1.x

License

MIT

hrpmangular-app-automationez-localize@blackpixel/framer-navbarcomponent@blackpixel/framer-remotelayer@blackpixel/framer-statusbarlayer@blackpixel/framer-carouselcomponent@blackpixel/framer-controlpanellayer@blackpixel/framer-focusengine@blackpixel/framer-gradienthelperreact-starterroots-browserifysimple-modalsite-masterscriptrserverbricksshampoostudentbeanspreventoverscrolljsprofacts-js-consultpolymer-serveproxydevserversails_proxy@cypress/browserify-preprocessorrun-jssaronsaron-startervinyl-phantomicweb-buildweb-build-tasksweb-build-toolswave-pendulumwatsonwintersmith-browserifyws-additionsundertherulesurl-filtervagrantvmusecase-coffeesrctext-3d-particlestgoltitanjssyn-dev-toolsstofstik-coffee-projecttailgatetaliotbg_media_querytbg_react_domwork-paragonyaksyaks_plugins@kynikos/browserify-helperscv-emaildate_pickerderby-standalone-builderderby-starterderby-starter2cofferdry-langdynaware-gulp-tasksds-packelm-gulp-coffeescript-stylus-lodash-browserify-boilerplateem-project-builderem-project-develixir-coffeeifyartsy-elanatg-webawesome-websocketav@pragli/avcolumn-controlcompiln-browserifycoffee-projectcoffee418cta-scr-api-client-durban-2015epiquery2eventful-promiseexpress-cjscatberry-coffeecarte-clientchem-clicaching-coffeeifycaesium-coffeegastropodfe-gulpframer-googlefontsframer-iconframer-labelframer-materialframer-remotelayerframer-youtube-playerframerjsgee-buildgif.jsifygoodeggs-karmagoodeggs-angular-browserifygoodeggs-assets-cligrunt-browserifyinggrunt-coffeeifybootstrap-kit-express
3.0.1

4 years ago

3.0.0

4 years ago

2.1.0

5 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.0

7 years ago

0.7.0

7 years ago

0.6.0

8 years ago

0.5.2

8 years ago

0.5.1

8 years ago

0.5.0

8 years ago

0.4.1

8 years ago

0.4.0

9 years ago

0.3.0

9 years ago

0.2.0

9 years ago

0.1.0

9 years ago

0.0.0

9 years ago