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 🙏

© 2025 – Pkg Stats / Ryan Hefner

fluent-git

v0.1.2

Published

A JS/TS library to use git fluently 😎

Readme

Fluent Git

npm node size npm deps tests cover

Features:

  • [x] git-notes basic subcommand (add, remove, show, etc) with handler:
    • [x] atCommit()
    • [x] atFile()
    • [x] atFolder()
    • [ ] atSubmodule()
    • [ ] atTag()
  • [ ] git-log...
    • [ ] search and list notes
    • [ ] search and list commit
  • [ ] git-checkout...
  • [ ] git-hooks...

Getting Started

To begin, you'll need to install fluent-git:

npm install fluent-git

or if you use yarn

yarn add fluent-git

git-notes [man]

tl;dr -- see example on each operation or handler

import { notes } from "fluent-git";

notes([text|][,options]) is a function that take 2 arguments and both of them are optional:

  • text - string that can be either SHA-1, HEAD, or notes.
  • options - string that point to --ref. Or Object which represent the Options.
notes()[handler](...)[operation](...)
// or
notes({
  ...Options
})[handler](...)[operation](...)

// in case you need autocompletion in typescript
const $notes = notes() as NoteUse.Manually
  • Available operation: add, overwriteWith, copyFrom, append, remove, show
  • Available handler: at, atCommit, atFile, atFolder
notes('some long notes')[operation][handler](...)

// in case you need autocompletion in typescript
const $notes = notes('some long notes') as NoteUse.Text
  • Available operation: add, overwrite, copy, append
  • Available handler: at, atCommit, atFile, atFolder
const sha = '69f3c3d' // or 'HEAD'
notes(sha)[operation](...)

// in case you need autocompletion in typescript
const $notes = notes('69f3c3d') as NoteUse.Hash
  • Available operation: add, overwriteWith, copyFrom, append, remove, show
  • Available handler: at, atCommit, atFile, atFolder

Operation

  • Arguments: string
  • Expected value: any string that represent notes but it can not be hash string or word HEAD
  • Return: ~

Example

notes().at(sha).add("some long notes");
notes("some long notes").add.at(sha);
notes("af23339").add("some long notes");
  • Arguments: ~
  • Expected value: ~
  • Return: ~

Example

notes().at(sha).remove();
notes("af23339").remove();
  • Arguments: ~
  • Expected value: ~
  • Return: string

Example

mynotes1 = notes().at(sha).show();
mynotes2 = notes("af23339").show();
console.log(String(mynotes1 + "\n" + mynotes2));
  • Arguments: string
  • Expected value: any string that represent notes but it can not be hash string or word HEAD
  • Return: ~

Example

notes().at(sha).append("some long notes");
notes("some long notes").append.at(sha);
notes("af23339").append("some long notes");
  • Arguments: string
  • Expected value: any string that represent notes, hash string, or word HEAD
  • Return: ~

Example

const sourceNotes = "HEAD";
notes().at(sha).overwriteWith("some long notes");
notes().at(sha).overwriteWith(sourceNotes);
notes("some long notes").overwrite.at(sha);
notes("af23339").overwriteWith("some long notes");
notes("af23339").overwriteWith(sourceNotes);
  • Arguments: string
  • Expected value: must be hash string or word HEAD
  • Return: ~

Example

notes().at(sha).copyFrom("b0279ab");
notes("some long notes").copy.at("af23339"); // same as `add` operation
notes("af23339").copyFrom("b0279ab");

Handler

  • Arguments: string
  • Expected value: must be hash string or word HEAD

Example

notes().at("af23339").show();
notes().at("HEAD").show();
  • Arguments: string
  • Expected value: must be valid commit message

Example

notes().atCommit("Initial commit").show();
  • Arguments:
    • filename - string
    • commit - string
  • Expected value:
    • commit - commit message or commit-id (SHA-1)
    • filename - a valid filename of that specific commit. Can include relative path (without ./) but not with absolute path

Example

notes().atFile("README.md", "Initial commit").show();
notes().atFile("README.md", "af23339").show();
notes().atFile("packages/mod1/README.md", "HEAD").show();
  • Arguments:
    • folder - string
    • commit - string
  • Expected value:
    • commit - commit message or commit-id (SHA-1)
    • folder - a valid folder of that specific commit. Must be relative path without prefix ./ and suffix '/'

Example

notes().atFolder("src", "Initial commit").show();
notes().atFolder("src", "af23339").show();
notes().atFolder("packages/mod1/src", "HEAD").show();

Options

The options are the combination of execa options plus this:

{
  ref: String; // represent flag --ref in git-notes
}

Who use this?

Contributing


License

FOSSA Status