# commonjs-concat

> take a directory of common js files and make a single file to export them all

Latest version **1.0.3** (published 2015-05-04) · Apache 2 license · 0 weekly downloads

## Install

```sh
npm install commonjs-concat
pnpm add commonjs-concat
yarn add commonjs-concat
bun add commonjs-concat
```

Provides the command `cjs-concat`.

## 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 | 1.0.3 |
| Published | 2015-05-04 |
| First published | 2015-05-04 |
| Weekly downloads | 0 |
| License | Apache 2 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Todd Kennedy |
| Maintainers | toddself |
| Keywords | concat, commonjs, export |

## Links

- npm: https://www.npmjs.com/package/commonjs-concat
- Repository: https://github.com/toddself/commonjs-concat
- Issues: https://github.com/toddself/commonjs-concat/issues
- npm.io page: https://npm.io/package/commonjs-concat

## Dependencies (4)

- [xtend](https://npm.io/package/xtend.md) ~4.0.0
- [minimist](https://npm.io/package/minimist.md) ~1.1.1
- [readdirp](https://npm.io/package/readdirp.md) ~1.3.0
- [camel-case](https://npm.io/package/camel-case.md) ~1.1.1

## Recent versions

- 1.0.3 (latest) — 2015-05-04
- 1.0.2 — 2015-05-04
- 1.0.1 — 2015-05-04
- 1.0.0 — 2015-05-04

## README

[![build status](https://secure.travis-ci.org/toddself/commonjs-concat.png)](http://travis-ci.org/toddself/commonjs-concat)

# commonjs-concat

Take a directory of files and create a single file which exports all the files in the directory structure.

## Usage

### CLI

```
$ npm i -g commonjs-concat
$ tree test/fixtures
test/fixtures
├── more
│   └── testing.js
├── test-file-1.js
├── test_file-2.js
└── testing.json
$ cjs-concat test/fixtures
exports.testFile1 = require('/Users/todd/src/commonjs-concat/test/fixtures/test-file-1.js');
exports.testFile2 = require('/Users/todd/src/commonjs-concat/test/fixtures/test_file-2.js');
exports.testing = require('/Users/todd/src/commonjs-concat/test/fixtures/more/testing.js');
# cjs-concat test/fixtures --no-relative -f"*json"
exports.testFile1 = require('./test-file-1.js');
exports.testFile2 = require('./test_file-2.js');
exports.testing = require('./testing.json');
exports.testing1 = require('./more/testing.js');
```

```
Usage:
    cjs-concat PATH [options]

Options:
    -h, --help         print usage information
    -v, --version      show version info and exit
    -o, --output       Write output to file, default: stdout
    -d, --ignoreDir    Ignore directories, default: node_modules
    -f, --includeFile  Include other file patterns. default: *.js
    --no-relative      Make paths relative to PATH
```

### API

```js
> var concat = require('commonjs-concat');
> concat('test/fixtures', {includeFile: '*json', relative: false}, function(err, output) {
  console.log(output);
});
exports.testFile1 = require('./test-file-1.js');
exports.testFile2 = require('./test_file-2.js');
exports.testing = require('./testing.json');
exports.testing1 = require('./more/testing.js');
```

### Licence
Copyright 2015 Todd Kennedy, Apache 2 license

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