# fcompose

> A file composer

Latest version **0.2.1** (published 2013-05-16) · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

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

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2013-05-16 |
| First published | 2012-12-26 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | yuanchuan |
| Maintainers | yuanchuan |
| Keywords | file, compose, packer, pipe |

## Links

- npm: https://www.npmjs.com/package/fcompose
- Repository: https://github.com/yuanchuan/fcompose
- npm.io page: https://npm.io/package/fcompose

## Dependencies (1)

- [mkdirp](https://npm.io/package/mkdirp.md) ~0.3.4

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 0.2.1 (latest) — 2013-05-16
- 0.2.0 — 2013-05-16
- 0.1.0 — 2012-12-26

## README

#fcompose 
>Compose one or multiple files into one or mulitple places.

## Installation

```bash
$ npm install fcompose
```

## Example

**fcompose as a pipeline**

```javascript
var compose = require('fcompose');

compose('origin.txt', 'output.txt', function(buffer, next) {
  next(             
    buffer.toString().toUpperCase()
  );
});
```     

**fcompose as a packer**

```javascript
var compose = require('fcompose')

compose({
    input:  ['a.js' , 'b.js' , 'c.js']
  , output: ['path/to/abc.js', 'path/to/abc2.js']
  , processor: function(buffer, next) {
      next(minify(buffer.toString())
    },
  , done: function(stamp) {
      console.log(stamp);
    }
}); 

// Quick and dirty way to strip white spaces.
function minify(input) {
  return input
    .replace(/^\s*/g, '')
    .replace(/\n*/g, '')
    .replace(/\s*([\=\.\(\)\:\{\}\,])\s*/g, '$1') 
}
```

## License
MIT

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