Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

remote-svn

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remote-svn

Promise wrapped classes easy to use for making operations on SVN without risking locks and conflicts

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

RemoteSvn / LocalSvn

perform operations on remote copy of SVN or Read only operations on a Local copy

Getting Started

checkout to your computer and run: npm install, to run mocha use: npm run test-local / test-remote (edit credentials)

referance the module

create a svn object

const testSvn = new remoteSvn();

Create log output interface

implement info error and debug functions, accept string, do whatever you want with it

logger =  { //looger interface
    info:(str)=>{console.log("[INFO]",str)},
    error:(str)=>{console.error("[ERROR]",str)},
    debug:(str)=>{console.warn("[DEBUG]",str)}
}

Create credentials object

creds = {
    username: "my.username",
    password: "myPassword123"
}

initialize the object pass the name of the folder you want the local files to be saved at, pass the base URL of the svn remote pass the logger interface function pass the credentials object (match the names)

svnConfig = {baseFolder, baseURL, logger, creds}
const params = await testSvn.init(svnConfig)
  • some examples ...

all operations returns a Promise, and perform async operations

const returnFilePath = await testSvn.getFile({"filePath":testFiles[0], "revision":undefined})

all operations that require parameters expect an object with a key:value for every parameter

await testSvn.deleteFiles({filePaths:[testFiles[0],testFiles[1]],message:commitMessage})

all downloaded files / newly created files are stored localy, remember to delete them when finished

await testSvn.deleteFiles({filePaths:[testFiles[0],testFiles[1]],message:commitMessage})

Prerequisites

must have svn v1.8 or later installed, one of the packages relay on svnmucc which is included in that version

svnmucc put _localPath_ _remotePath_

Running the tests

Edit the .env file , fill in missing details Use mocah ( installed globaly using npm i -g mocha) or use "npm run test-remote" or use "npm run test-local"

Break down into end to end tests

you can take example from the tests on how to get/add/remove a file and commit

Built With

  • node-svn-ultimate - SVN wrapper for node
  • fs-extra - file system methods
  • count-files - Count files, directories, and bytes in a directory recursively.
  • mocha - Simple, flexible, fun JavaScript test framework for Node.js & The Browser.

Authors

License

GNUv3

Acknowledgments

  • stackOverflow
  • coffee

FAQs

Package last updated on 02 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc