index.js
function startUp(dir) {
    var config = {
        jcr_root: dir,
        servers: [{
                host: commander.host || "http://localhost:4502",
                username: commander.username || "admin",
                password: commander.password || "admin"
            }]
    };
    //create a new instance
    var sling2JCR = new sling2jcr_1.Sling2JCR(config.servers);
    sling2JCR.login().then(function (servers) {
        //watch the files under the jcr_root folder, or any sub directory under it. Files not under a sub directory of jcr_root won't be synchronized.
        watch(config.jcr_root, function (filePath) {
            if (fs.existsSync(filePath)) {
                if (fs.statSync(filePath).isFile()) {
                    sling2JCR.process(filePath);
                }
            }
            else {
                sling2JCR.process(filePath, true);
            }
        });
    }).catch(function (error) {
        console.log(error);
    });
}
function startUp(dir) {
    var config = {
        jcr_root: dir,
        servers: [{
                host: commander.host || "http://localhost:4502",
                username: commander.username || "admin",
                password: commander.password || "admin"
            }]
    };
    //create a new instance
    var sling2JCR = new sling2jcr_1.Sling2JCR(config.servers);
    sling2JCR.login().then(function (servers) {
        //watch the files under the jcr_root folder, or any sub directory under it. Files not under a sub directory of jcr_root won't be synchronized.
        watch(config.jcr_root, function (filePath) {
            if (fs.existsSync(filePath)) {
                if (fs.statSync(filePath).isFile()) {
                    sling2JCR.process(filePath);
                }
            }
            else {
                sling2JCR.process(filePath, true);
            }
        });
    }).catch(function (error) {
        console.log(error);
    });
}
function startUp ( dir ) { var config = { jcr_root : dir , servers : [ { host : commander . host || "http://localhost:4502" , username : commander . username || "admin" , password : commander . password || "admin" } ] } ; //create a new instance var sling2JCR = new sling2jcr_1 . Sling2JCR ( config . servers ) ; sling2JCR . login ( ) . then ( function ( servers ) { //watch the files under the jcr_root folder, or any sub directory under it. Files not under a sub directory of jcr_root won't be synchronized. watch ( config . jcr_root , function ( filePath ) { if ( fs . existsSync ( filePath ) ) { if ( fs . statSync ( filePath ) . isFile ( ) ) { sling2JCR . process ( filePath ) ; } } else { sling2JCR . process ( filePath , true ) ; } } ) ; } ) . catch ( function ( error ) { console . log ( error ) ; } ) ; }
end with parse to parse through the input
end with parse to parse through the input