nodesvn documentation

npm size license downloads

A napi module that wraps subversion

OS Architecture Supported
Windows x64 Yes
Windows x86 No
Windows arm No
Linux x64 No
Linux arm No
MacOS N/A No

npm install napi-svn

List files in repository

results = svn.ls(URL, options);
results.forEach(element => {
    console.log(element);
});

Display log history of repository

const options = {
    username: "user",
    password: "password",
    autoconnect: true,
    verbose: false
};

const revision = {
    URI: [URL],
    revision_range: {
        start: {
            kind: svn.svn_opt_revision_number,
            value: 0
        },
        end: {
            kind: svn.svn_opt_revision_head,
        }
    }
};
 
svn.log(revision, (log) => {
    console.log(log);
}, options);

Display content of a file

const options = {
    username: "user",
    password: "password",
    autoconnect: true,
    verbose: false
};

console.log(svn.cat(urljoin(URL, "LICENSE"), options));

Checkout repository

const options = {
    username: "user",
    password: "password",
    autoconnect: true,
    verbose: false
};
    
svn.checkout(URL, path, (action) => {
    console.log(action);
}, options);

Upgrade repository

const options = {
    username: "user",
    password: "password",
    autoconnect: true,
    verbose: false
};
    
svn.upgrade(path, options);

Export repository

const options = {
    username: "user",
    password: "password",
    autoconnect: true,
    verbose: false
};
    
svn.export(URL, path, (action) => {
    console.log(action);
}, options);

ls(url[, options])

List directory entries in the repository

log(revision, callback[, options])

cat(url[, options])]

checkout(url, path, callback[, options])]

upgrade(path[, options])]

export(url, path, callback[, options])]

Repository authentication object

{
    // These properties are the the standard svn command
    username: "user",      // login username 
    password: "password",  // login password
    autoconnect: false,    // auto accept certifcate 
    verbose: false // verbose logging setting
}

Revision range object for the log command

{
    URI: [URL],
    revision_range: {
        start: {
            kind: svn.svn_opt_revision_number,
            value: 0
        },
        end: {
            kind: svn.svn_opt_revision_head,
        }
    }
}

MIT

Help support future development by making a one time payment.