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

git-json

v1.0.17

Published

git-json, fully functional git in node

Downloads

28

Readme

Build Status

git-json

var gitjson = require('git-json')
var git = gitjson()

git.pipe(process.stdout)

git.init()
git.save('mydocument',{foo:'bar',val:2})
git.add('mydocument')
git.commit('first commit')
git.log()

your new working and staging functions

This chart summarizes the functions you will use in working vs staging.

| | Working | Staging | |------|---------|---------| |save | .save | .add | |trash| .delete | .remove |

.log()

Produces a git log similar to git log --all --decorate

Git-json Log Image

.save(name,content)

Save content under "file" name into the working directory

.add(name)

Places "file" name into the staging index.

.delete(name)

Delete content under "file" name from the working directory

.remove(name)

Issues a Remove "file" name order into the staging index

.commit(message,opts={})

Peforms a commit with message. Optional opts, specify committer and/or author to override git-config globals.

.branch(branchname)

Create a branch with branchname. Call without arguments to get current named branch or detached state HEAD.

.checkout(branchname)

Returns the contents at the tip of branchname

.merge(branchname,opts={})

Peforms a fast forward merge. Optional opts, specify {noff:true} in the opts to prevent fast forward merges.

.ancestor(branchname)

Returns true if current branch tip is upstream of branchname

.isupstream(branchname)

Returns true if branchname is upstream of HEAD

.rebase(branchname)

Rebases current branch onto branchname.

.hash_object(item,isWrite)

Returns the sha-1 hash of item as used in this and Git. Pass an optional second argument true to specify that the object be written into the blob store.

.cat_file(sha)

Returns the blob specified by the sha-1 hash.


Other useful functions

.config(obj)

Sets the git configuration. Typical use is

git.config({user:{email:'[email protected]',name:'Joe Bar'}})
.branch()

Returns the list of all branches and indicates which branch you are on.

.visual()

Show a tree-based visual representation of the repository

.filehistory(name)

Returns the filehistory of name across all branches. Restrict output with an optional branchname or commit argument.

Contributions

Please contribute, as I actively monitor discussions and pull requests. Note the TODO list

TODO

Pencil Todo git remove
Pencil Todo NonFF merge with conflicts / rebase with conflicts
Pencil Todo garbage collection
Pencil Todo multiple parents preservation on merge
Pencil Todo rev-parse --verify and other revparse options

Recently added

  • NonFF merge without conflicts
  • git rebase without conflicts
  • treelib with commit hashes for visualizations

Thanks

#git on freenode. trash icon provided by http://www.aspneticons.com/ Disk icon provided by http://www.aha-soft.com

Copyright (C) 2016 David Wee

License MIT