0.0.26 • Published 9 years ago

filejoin-js v0.0.26

Weekly downloads
2
License
GNU General Publi...
Repository
github
Last release
9 years ago

filejoin-js

filejoin-js is a Node.js application used to merge multiple files into a single one

Installation

npm -g install filejoin-js

Command-Line Options:

-c     <path to config.json>
-r     <path to a root directory>
-t     <long pooling refresh time for watching>
-rcwd  (if this is set and no root file is defined, root file will be current directory)
-watch (enable this to start long pooling check)
-debug (use this for debug mode writing)

Config file sample:

[
    {
        "out": "sample1.txt",
        "in": [
            "input1.txt",
            "input2.txt",
            "input3.txt"
        ]
    },

    {
       "out": "sample2.txt",
       "in": [
            "input1.txt",
            "input2.txt",
            "input3.txt"
       ]
    }
]

Command-Line Samples:

Create a one-time build

filejoin -c /user/config.json -r /myproject

Create a watcher:

filejoin -c /user/config.json -r /myproject -watch -debug

Create a watcher with files and config.json in current folder:

filejoin -rwcd -watch

Code Sample:

var FileMerger = require('filejoin-js').FileMerger;

var merger = new FileMerger([
    {out: 'sample2.txt', in: ['input1.txt', 'input2.txt']},
    {out: 'sample2.txt', in: ['input1.txt', 'input2.txt']}
], '/examples/', true);

// since version 0.0.18:
merger.onWatcherUpdate = function() {
    console.log('some update done');
};

merger.doMerge();

customize the watcher behaviour by keeping cache data: (since version 0.0.24)

var merger = new lib.FileMerger(config, path, true);
merger.keepCache = true;

function selfWork() {
    merger.doMerge();
    setTimeout(function() {
        selfWork();
    }, 1000);
}

selfWork();

merger.onWatcherUpdate = function(args) {
    console.log('some update done for file ' + args.outputName);
};

merger.onCheckFinished = function() {
    console.log('check finished tick!');
}

retrieve existing config file for other operations: (since version 0.0.24)

var merger = new lib.FileMerger(config, path, true);
console.log(merger.getConfig());

GNU General Public License

Copyright (C) 2014  Alexandru Stefan

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see http://www.gnu.org/licenses/.
0.0.26

9 years ago

0.0.25

9 years ago

0.0.24

9 years ago

0.0.23

9 years ago

0.0.22

9 years ago

0.0.21

9 years ago

0.0.20

9 years ago

0.0.19

9 years ago

0.0.18

9 years ago

0.0.17

10 years ago

0.0.16

10 years ago

0.0.15

10 years ago

0.0.14

10 years ago

0.0.13

10 years ago

0.0.12

10 years ago

0.0.11

10 years ago

0.0.10

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago

0.0.0

10 years ago