# coffeeify

> browserify plugin for coffeescript with support for mixed .js and .coffee files

Latest version **3.0.1** (published 2017-11-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install coffeeify
pnpm add coffeeify
yarn add coffeeify
bun add coffeeify
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.1 |
| Published | 2017-11-03 |
| First published | 2013-03-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/coffeeify) |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 216 |
| Maintainers | substack, jnordberg |
| Keywords | coffeescript, coffee-script, browserify, v2, js, plugin, transform |

## Links

- npm: https://www.npmjs.com/package/coffeeify
- Repository: https://github.com/jnordberg/coffeeify
- Issues: https://github.com/jnordberg/coffeeify/issues
- npm.io page: https://npm.io/package/coffeeify

## Dependencies (2)

- [through2](https://npm.io/package/through2.md) ^2.0.0
- [convert-source-map](https://npm.io/package/convert-source-map.md) ^1.3.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 3.0.1 (latest) — 2017-11-03
- 3.0.0 — 2017-09-29
- 2.1.0 — 2016-12-06
- 2.0.1 — 2015-12-12
- 2.0.0 — 2015-12-12
- 1.2.0 — 2015-11-20
- 1.1.0 — 2015-04-26
- 1.0.0 — 2014-11-13
- 0.7.0 — 2014-07-20
- 0.6.0 — 2014-01-30
- 0.5.2 — 2013-10-17
- 0.5.1 — 2013-06-02
- 0.5.0 — 2013-06-01
- 0.4.1 — 2013-05-30
- 0.4.0 — 2013-04-07
- … 4 more at https://npm.io/package/coffeeify/versions

## README

# coffeeify [![Build Status](https://travis-ci.org/jnordberg/coffeeify.svg?branch=master)](https://travis-ci.org/jnordberg/coffeeify)

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:

```coffee
console.log require './bar.js'
```

bar.js:

```javascript
module.exports = require('./baz.coffee')(5)
```

baz.coffee:

```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:

```shell
$ 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:

```javascript
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

Name       | Default   | Description
-----------|-----------|-------------------------------------------------------------------------------------------
sourceMap  | `null`    | Generate source maps, deteremined from browserify's `--debug` option if not set.
bare       | `true`    | Omit the `(function(){ .. }).call(this);` wrapper.
header     | `false`   | Include the `// Generated by CoffeeScript <version>` header in every file processed.

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

```coffee
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](https://npmjs.org) do:

```bash
npm install --save-dev coffeeify
```

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

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

## License

MIT

---
_Source: https://npm.io/package/coffeeify · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
