npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@taiyosen/easy-svn

v1.0.29

Published

Make svn easy to be used in nodejs.

Downloads

294

Readme

easy-svn

Make it easy to use svn in nodejs.

Install

First, make sure a command SVN has been installed, such as CollabNetSunversion.

Then~

npm i @taiyosen/easy-svn

How to use

let svn = new SVNClient();
// config is optional.
svn.setConfig({
    repository: 'svn://your-svn-repository', 
    username: 'your-svn-username', 
    password: 'your-svn-password', 
    cwd: 'E:/your-svn-workspace', 
    silent: true
});

// show the log messages for any incoming changes
await svn.log(['.'], { revision: 'BASE:HEAD', verbose: true });
// or
await svn.log('.', '-r', 'BASE:HEAD', '-v');

await svn.cleanup();  // cleanup E:/your-svn-workspace
await svn.cleanup(true, 'E:/foo');  // cleanup E:/foo

await svn.revert();  // revert E:/your-svn-workspace
await svn.revert('E:/foo', 'E:/bar');  // revert E:/foo & E:/bar

await svn.update();  // update E:/your-svn-workspace

await svn.addUnversioned('.');  // add unversioned files in .

await svn.checkout('svn://your-svn-repository/some-folder');  // check out into some-folder
await svn.checkout('svn://your-svn-repository/some-folder', 'the-specified-folder');  // check out into a specified folder
// you can also checkout a single file, like:
await svn.checkout('svn://your-svn-repository/some-folder/some-file.ts');

Set a default configuration

  • [repository] - works if no url given when calling checkout
  • [username] - --username option will be enabled
  • [password] - --password option will be enabled
  • [cwd] - works as the default path when calling checkout/update/commit/...
  • [silent] - no log or error details if set true
SVNConfig {
    repository?: string;
    username?: string;
    password?: string;
    cwd?: string;
    silent?: boolean;
}

Check out

async checkout(url?: string | string[], path?: string, option?: CheckoutOption): Promise<string>;

update

async update(paths: string[], option?: UpdateOption): Promise<string>;
/**@deprecated */
async update(...paths: string[]): Promise<string>;

commit

async commit(paths: string[], option?: CommitOption): Promise<string>;
/**@deprecated */
async commit(msg: string, ...paths: string[]): Promise<string>;

add

async add(paths: string[], option?: AddOption): Promise<string>;
/**@deprecated */
async add(...paths: string[]): Promise<string>;

del

async delete(paths: string | string[], option?: DeleteOption): Promise<string>;
/**@deprecated */
async del(msg: string, ...paths: string[]): Promise<string>;

info

async info(targets: string[], option?: InfoOption): Promise<string>;
/**@deprecated */
async info(...targets: string[]): Promise<string>;

status

async status(paths: string[], option?: StatusOption): Promise<string>;
/**@deprecated */
async status(...paths: string[]): Promise<string>;

log

async log(paths: string[], option?: LogOption): Promise<string>;
/**@deprecated */
async log(path?: string, ...options: string[]): Promise<string>;

revert

async revert(...paths: string[]): Promise<string>;

cleanup

async cleanup(rmUnversioned?: boolean, ...wcpaths: string[]): Promise<string>;

addUnversioned

async addUnversioned(...paths: string[]): Promise<string>;

getRevision

async getRevision(url?: string): Promise<number>;

ignore

async ignore(wcRoot: string, ...ignoreList: string[]): Promise<boolean>;

copy

async copy(src: string, dst: string, option?: CopyOption): Promise<string>;

list

async list(target: string | string[], option?: ListOption): Promise<string>

lock

async lock(target: string | string[], option?: LockOption): Promise<string>

unlock

async unlock(target: string | string[], option?: UnlockOption): Promise<string>

any command

async cmd(command: string, params?: string[], options?: SpawnOptionsWithoutStdio): Promise<string>

for example:

import { SVNClient } from "@taiyosen/easy-svn";

const svn = new SVNClient();
await svn.cmd('add', ['--force', '--parents', '--no-ignore', '.']);