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

hg-plus

v1.2.3

Published

A Mercurial client for Node

Downloads

8

Readme

Coverage Status Build Status Dependency Status devDependency StatusCode ClimateLicense: MIT

node-hg-plus

A node js client for Mercurial. Supports both Async/Await/Promises and Standard callbacks.

Supported node version => 7.6.0

Table of Contents

Install

# Install from npm

npm install -S hg-plus

To use the gitify function, you must also have python2.7.x, git as well as the shipped gitifyhg python addon installed.

To install the addon simply run:

cd node_modules/hg-plus/utils/gitifyhg/
python2.7 setup.py install

Note this feature currently has mixed results on windows. Working on fixing that functionality for the next release.

Usage

Basic

// Initialize with default python path ('python')
const Hg = require('hg-plus')();

// Clone a repo using only the url string
let repo = await Hg.clone('http://hostname.com/my/repository/url')
	
await repo.add()
await repo.commit('my example commit')
await repo.push({ password: 'myPassword', username: 'username' })

Create and push a repository

const Hg = require('hg-plus')();

let to = { 
	url: 'http://hostname.com/my/repository/url', 
	username: '[email protected]', 
	password: 'secret'
}

let repo = await Hg.create(to);

await repo.push()

Cloning from multiple repositories into a new one

const Hg = require('hg-plus')();

let to = { 
	url: 'http://hostname.com/my/repository/url'
}

let from = [
	'http://hostname.com/my/repository/url1', 
	'http://hostname.com/my/repository/url2', 
	'http://hostname.com/my/repository/url3'
]

let repo = await Hg.clone(from, to);

await repo.commit('I just created a repository from three other repositories!')
await repo.push({ 	
	username: '[email protected]', 
	password: 'secret'
})

Hg to Git conversion caveats

This functionality is still in development. There are a few issues that arise if for example, there are conflicting branches during the clean processing. Before merging repositories, ensure that the branch names(besides default) do not conflict. If it errors out for you, try running the conversion without the clean option.

Tests

Ensure to install the gitifyhg library as outlined at the beginning of this README then make sure to change the global variable in tests/HgRepo called pythonPath to be a valid path to your python2.7.x installation. Then run:

npm test

LICENSE

MIT, No Attribution Required, Copyright 2016 Justin Dalrymple

Changelog

1.2.3 (2018-4-29)

  • Updating library dependencies

1.2.2 (2017-10-29)

  • Added Checkout alias for hg update
  • Added branch specification for hg update
  • Updating library dependencies

1.2.1 (2017-10-29)

  • Updating error messages for the creation of hg repositories
  • Updating Hg.getRepo to return the correct remote url in the HgRepo instance
  • Added HgRepo.paths()

1.2.0 (2017-10-03)

1.1.0 (2017-08-29)

  • Renamed the Hg.gitify function gitRepoPath parameter to be just path
  • Made HgRepo objects gitify function take in an object with a output path, path, a remoteURL option, an option to track all of the git branches after the conversion, and an option to clean the git branch names during conversion
  • Major updates the the gitifyhg library

1.0.2 (2017-07-30)

1.0.1 (2017-07-26)

  • Removed the .hgtags and hg folders from the gitified repo
  • Rename .hgignore to be .gitignore and removing 'syntax*' line from the .gitignore file

1.0.0 (2017-07-25)

  • Cleaned up old promise logic and replaced with async/await
  • Removed useless rest param arguments from many of the Hg functions for clarity
  • Added Object input to the Hg.Clone function (See API Docs above)
  • Cleaned up folder structure
  • Fixed the setting of the default url if none is passed in by the user
  • Fixed cloning from urls instead of local paths
  • Added various callback tests to ensure the callback backwards compatibility is maintained
  • Added default state tests for the HgRepo Object
  • Removed old dependencies now that Promises are more widely supported
  • Standardized the callback support to return in the form callback(error, results) always

NOTE: Upgrading from 0.8.0 to 1.0 will break your project. Ensure to add the function call to your require statement - require('hg-plus')()