commonjs-concat
take a directory of common js files and make a single file to export them all
Last updated 5 years ago by toddself .
Apache 2 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install commonjs-concat 
SYNC missed versions from official npm registry.

build status

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

> 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

Current Tags

  • 1.0.3                                ...           latest (5 years ago)

4 Versions

  • 1.0.3                                ...           5 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 5
Dependencies (4)
Dev Dependencies (4)

Copyright 2014 - 2016 © taobao.org |