Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/okunishinishi/node-fileconcat

Node.js module to concat multiple files into one.
https://github.com/okunishinishi/node-fileconcat

Last synced: 2 months ago
JSON representation

Node.js module to concat multiple files into one.

Awesome Lists containing this project

README

        

fileconcat
==========

[![Build Status][bd_travis_shield_url]][bd_travis_url]
[![Code Climate][bd_codeclimate_shield_url]][bd_codeclimate_url]
[![Code Coverage][bd_codeclimate_coverage_shield_url]][bd_codeclimate_url]
[![npm Version][bd_npm_shield_url]][bd_npm_url]
[![JS Standard][bd_standard_shield_url]][bd_standard_url]

[bd_repo_url]: https://github.com/okunishinishi/node-fileconcat
[bd_travis_url]: http://travis-ci.org/okunishinishi/node-fileconcat
[bd_travis_shield_url]: http://img.shields.io/travis/okunishinishi/node-fileconcat.svg?style=flat
[bd_license_url]: https://github.com/okunishinishi/node-fileconcat/blob/master/LICENSE
[bd_codeclimate_url]: http://codeclimate.com/github/okunishinishi/node-fileconcat
[bd_codeclimate_shield_url]: http://img.shields.io/codeclimate/github/okunishinishi/node-fileconcat.svg?style=flat
[bd_codeclimate_coverage_shield_url]: http://img.shields.io/codeclimate/coverage/github/okunishinishi/node-fileconcat.svg?style=flat
[bd_gemnasium_url]: https://gemnasium.com/okunishinishi/node-fileconcat
[bd_gemnasium_shield_url]: https://gemnasium.com/okunishinishi/node-fileconcat.svg
[bd_npm_url]: http://www.npmjs.org/package/fileconcat
[bd_npm_shield_url]: http://img.shields.io/npm/v/fileconcat.svg?style=flat
[bd_standard_url]: http://standardjs.com/
[bd_standard_shield_url]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg

Concat multiple files into one.


Installation
-----

```bash
npm install fileconcat --save
```


Usage
----

**fileconcat(src, dest, callback)**

```javascript
'use strict'

const fileconcat = require('fileconcat')

let src = [
'src/javascripts/lib/*.js',
'src/javascripts/*.js'
]
let dest = 'dist/javascripts/all.js'

// Concat files into one.
fileconcat(src, dest).then(() => {
/* ... */
})

```

**fileconcat(src, dest, options, callback)**

```javascript
'use strict'

// Concat files into one with options.
fileconcat(src, dest, {
unique: true,
mkdirp: true,
mode: '444',
beforeEach (context) {
return '\n//======= ' + context.src + ' ==========\n'
}
}).then(() => {
/* ... */
})

```


Options
-------

| Key | Type | Description |
| --- | ---- | ----------- |
| unique | Boolean | Reject duplicate files. Use full when you pass multiple glob patterns. |
| mkdirp | Boolean | Make parent directories if needed. |
| mode | String | File permission |
| beforeEach | String#124;Function | String to append before each content. |
| afterEach | String#124;Function to append after each content. |

License
-------
This software is released under the [MIT License](https://github.com/okunishinishi/node-fileconcat/blob/master/LICENSE).