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 🙏

© 2026 – Pkg Stats / Ryan Hefner

front-git

v1.0.3

Published

you can manage frontend-data like git

Readme

Front-Git

This is a framework for JavaScript (TypeScript) that can manage data like Git.

Since it was made for studying, there is no practicality so far.

Example

import { createGit } from "front-git";

const initState = { name: "John", age: 31 };

const git = createGit(initState);

git.remote.set("origin", {
  push: done => {
    updateUser(get.getState())
      .then(done)
      .catch(console.error);
  },
  pull: async done => {
    const user = await getUser();

    if (user && user.name && user.age) {
      done(user);
    }
  }
});

git.subscribe("add", () => {
  console.log(`current index value : ${git.getIndex()}`);
  console.log(`cureent state value : ${git.getCurrentState()}`);
});

git.subscribe("commit", () => {
  console.log(`current commit logs : ${git.getLogs()}`);
  console.log(`state value : ${git.getState()}`);
});

git.pull("origin");

git.add({ name: "Hello World!" });
git.commit("first commit");

git.push("origin");

Usage

createGit

imoprt { createGit } from "front-git";

const initState = {
  hello: "world!"
};

const git = createGit(initState);

add

// ...

const git = createGit(initState);

// OK👌
git.add({ name: "Hoge" });
git.add({ age: 41 });
git.add({ name: "Hogu", age: 100 });
git.add({});

// NG👎
git.add();
git.add(null);
git.add(1);
git.add("");

commit

// ...

const git = createGit(initState);

// OK👌
git.add({ name: "hoge" }).commit();
git.add({ age: 100 }).commit("Hello!");

// NG👎
git.commit();
git.add({ name: "hoge" }).commit({ message: "Hello" });

subscribe

// ...

const git = createGit(initState);

git.subscribe("add", () => {
  console.log("Add was executed !");
});

git.subscribe("commit", () => {
  console.log("Commit was executed !");
});

git.add({ name: "hoge" }); // Add was executed !

git.commit(); // Commit was executed !

getIndex

// ...

const git = createGit(initState);

let index = git.getIndex(); // null

git.add({ name: "hoge" });

state = git.getIndex(); // { name: "hoge" }

git.commit();

state = git.getIndex(); // null

getState

// ...

const git = createGit(initState);

let state = git.getState(); // { name: "John", age: 31 }

git.add({ name: "hoge" });

state = git.getState(); // { name: "John", age: 31 }

git.commit();

state = git.getState(); // { name: "hoge", age: 31 }

getCurrentState

// ...

const git = createGit(initState);

let state = git.getCurrentState(); // { name: "John", age: 31 }

git.add({ name: "hoge" });

state = git.getCurrentState(); // { name: "hoge", age: 31 }

git.commit();

state = git.getCurrentState(); // { name: "hoge", age: 31 }

getLogs

// ...

const git = createGit(initState);

let logs = git.getLogs(); // []

git.add({ name: "hoge" }).commit("First Commit");

logs = git.getIndex();
/*
[
  { 
    id: "xxxxxxxxxxxx", 
    comment: "First Commit",
    log: { ex: { name: "John" }, diff: { name: "hoge" }  },
    created_at: new Date()
  }
]
*/

clearIndex

// ...

const git = createGit(initState);

let index = git.getIndex(); // null

git.add({ name: "hoge" });

state = git.getIndex(); // { name: "hoge" }

git.clearIndex();

state = git.getIndex(); // null

revertLog

// ...

// init
const git = createGit(initState);
let state = git.getState(); // { name: "John", age: 31 }
let logs = git.getLogs(); // []

// commit
git.add({ name: "hoge" }).commit();
state = git.getState(); // { name: "hoge", age: 31 }
logs = git.getLogs(); // [ {...} ]

// commit
git.add({ age: 100 }).commit();
state = git.getState(); // { name: "hoge", age: 100 }
logs = git.getLogs(); // [ {...}, {...} ]

// revertLog
git.revertLog();
state = git.getState(); // { name: "hoge", age: 31 }
logs = git.getLogs(); // [ {...} ]

// revertLog
git.revertLog();
state = git.getState(); // { name: "John", age: 31 }
logs = git.getLogs(); // []

remote.set

// ...

const git = createGit(initState);

// OK👌
git.remote.set("origin", {
  push: done => {
    updateUser().then(done);
  },
  pull: async done => {
    const user = await getUser();
    done(user);
  }
});

// NG👎
git.remote("origin", {});
git.remote("origin", { push: () => updateUser() });

push

// ...

const git = createGit(initState);

// OK👌
git.remote.set("origin", { push: ... , pull: ... });
git.push("origin");

// NG👎
git.push();
git.push("unknown");

pull

// ...

const git = createGit(initState);

// OK👌
git.remote.set("origin", { push: ... , pull: ... });
git.pull("origin");

// NG👎
git.pull();
git.pull("unknown");