Skip to content
This repository has been archived by the owner on Jan 23, 2022. It is now read-only.
/ node-svn Public archive

[Work In Progress] Wrap SVN to Node Native Addon.

License

Notifications You must be signed in to change notification settings

yume-chan/node-svn

Repository files navigation

node-svn

Maintenance

Currently I'm busy working and have no time to maintenance this project

Wrap Subversion (SVN) to Node Native Addon

Platform table

Build Tests
Windows AppVeyor Build AppVeyor Tests
Linux Travis CI Build
macOS Travis CI Build

Dependencies

Name Introduction Required by Note
node-apr-gen-test-char A node wrapper for apr's gen-test-char executable apr Used to generate a header file (apr_escape_test_char.h) required by apr
expat An XML parser apr
openssl crypto library serf See below
sqlite-amalgamation SQLite database subversion Unofficial mirror for amalgamation version
apr Apache Portable Runtime subversion apr-util has been merged into apr-2
serf An HTTP client library subversion
subversion Subversion library node-svn Only static libraries are used

Note for OpenSSL:

For Node.js, node.lib exports OpenSSL symbols, so this library can dynamic link to node.lib to use OpenSSL.

For Electron, io.lib doesn't export OpenSSL symbols (See this blog post for more information). So this library need to compile OpenSSL by itself.

The source code in dependencies/openssl folder is taken from nodejs/node repository, with a modified openssl.gyp to build as static library.

Patches

  1. Patch subversion SQLite initialization to use Serialize mode (see Thread Safety).
  2. Patch serf to support new version of OpenSSL (with OPENSSL_NO_DEPRECATED on)

Building

# Clone
git clone -b build-svn https://github.com/yume-chan/node-svn.git
cd node-svn

# Clone and patch submodules
git submodule update --init

# Build
npm install

# Tests
npm test

It will takes minutes to build (~120s on my i7-7567U 2C4T 4GHz, 8G DDR4 2133MHz, ~250s if openssl included), so sit back and relax yourself while it's doing its own things.

All dependencies will be compiled as static library and be linked into one single dynamic library to avoid any dynamic library searching path problems.

Docs

See the type definition

Thread safety

Svn has been designed to only work in single-thread mode. So you need to create new Client for each concurrency operatons.

Maybe a Client pool can be used to reduce overhead.

I have tried to enable all mutex in SQLite, but svn still crashes with random access violations.

Roadmap

  • Add options to all methods
  • Strongly-typed error handling
  • Async Iterator for methods like status()
  • Authentication
  • Cross platform
  • You name it

Help wanted! How to create custom Error class in Node.js Native Addon?

License

Name License Note
node-apr-gen-test-char MIT
openssl OpenSSL Node.js: MIT
sqlite-amalgamation BSD-3-clause SQLite: Public Domain
apr Apache 2.0
serf Apache 2.0
subversion Apache 2.0
node-svn MIT

About

[Work In Progress] Wrap SVN to Node Native Addon.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published