# coffeeify-cached

> browserify plugin for coffee-script with support for mixed .js and .coffee files (with compile cache)

Latest version **3.0.0** (published 2018-07-16) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2018-07-16 |
| First published | 2017-07-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 14.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | danielkalen |
| Keywords | coffee-script, browserify, v2, js, plugin, transform |

## Links

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

## Dependencies (5)

- [md5](https://npm.io/package/md5.md) ^2.2.1
- [through2](https://npm.io/package/through2.md) ^2.0.0
- [fs-jetpack](https://npm.io/package/fs-jetpack.md) ^1.1.0
- [coffeescript](https://npm.io/package/coffeescript.md) ^2.3.1
- [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.0 (latest) — 2018-07-16
- 2.1.1 — 2017-07-07
- 2.1.0 — 2017-07-07

## 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.

## Difference
The difference between this package and the original [coffeeify](http://ghub.io/coffeeify) is that this module caches coffeescript compilations according to the files' hashes and stores them to disk so that next time a file with the same hash will be processed re-compilation won't be needed.

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

```
$ npm install coffeeify
```

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:

```
npm install coffeeify
```

## License

MIT

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