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

4b82

v0.1.12

Published

4b82 Continuity Trustcenter Framework

Downloads

99

Readme

4b82 - Continuity Trustcenter Framework

Based on GIT and Merkle Tree

ps. 4B82 is the first four symbols of the hash value for the GIT empty-tree "tree 0\0" 4b825dc642cb6eb9a060e54bf8d69288fbee4904

4B82 Project Key Technical Details

The goal of this project is to allow a straightforward and robust way to establish abstract, provably immutable sequences of digital events.

Currently existing methods for attaining this rely on highly specialized software, are computationally demanding, or both.

We have decided to use GIT’s architectural framework as the core implementing this functionality because of its versatility, robustness, strong safeguards against corruption, as well as its self-evidential flexibility.

Strict linearity was achieved by leveraging hash functionality typical to all git-like solutions while eschewing branching functionality, and was done in a manner that minimizes unnecessary (for our purposes) overhead of typical git object behaviors (but does not compromise the formal integrity of the git structures involved).

Read more about 4b82 Continuity Trustcenter Framework at 4b82.com

How to Use it?

Initialize an empty git repository:

Create the new node.js project:

Add 4b82 code from npm:

Now, you can use 4b82 functions and make your own 4b82 server.

API Functions

Note: all callback functions are function (err, result) or function (err). if an error occurs then err object will be passed to callback function. Otherwise, err object is null and result object will be passed to the callback function (if result is exists).

Initialization

First, it is necessary to initialize the application.

During initialization, it is necessary to pass a configuration object. Currently, this object is simple and includes a git field. This field is an object with the path field which stores the path to the GIT repository. For example:

Configuration Object

Application Initialization

function init (conf)

| Arguments | Description | |:--- |:--- | | conf | Configuration object (see above) |

Exclusive Access

Before you make any changes to the GIT-repository, you must obtain an exclusive access to GIT-repository at the application level.

Important: please, do not forget to call releaseAccess() and to release exclusive access to the repository at the end of the operation.

Important: exclusive access is provided only at the application logic level, not the system level.

Obtain the Exclusive Access

function getAccess (callback)

| Arguments | Description | |:--- |:--- | | callback (err) | Callback function that calls immediately after receivingthe exclusive access to the GIT repository |

Release the Exclusive Access

function releaseAccess ()

| Arguments | Description | |:--- |:--- | | none | Releases the exclusive access to the GIT repository |

Adding and Reading Commits

Add a Commit to the Repository

function addCommit (message, author, committer, callback)

| Arguments | Description | |:--- |:--- | | message | Commit message | | author | Commit author | | committer | Committer (your system) | | callback (err, commit) | Callback function that receives commit object after adding or error |

Get the Recently Added Commit

function getRecentCommit (callback)

| Arguments | Description | |:--- |:--- | | callback (err, commit) | Callback function that receives commit object after adding or error.If there is no commits, null is returned. |

Get the Commit With Hash Value

function getCommit (hash, callback)

| Arguments | Description | |:--- |:--- | | hash | The hash value for the desired commit | | callback (err, commit) | Callback function that receives commit object after adding or error.If there is no commits, null is returned. |

Display the Commit Data

function prettyPrint (commit) - show information about commit

| Arguments | Description | |:--- |:--- | | commit | Commit object returned by addCommit, getRecentCommit or getCommit functions |

Examples

A simple application that adds commit to our fresh 4b82 git repository:

When you run this application it adds new commit to 4b82 git repository and prints the commit hash, data and deflated bytes.

To get specific commit use getCommit function:

This function returns commit object (with tag field).

commit contains whole git commit data, you can parse it for author, committer, e.t.c.

tag field uses for backward navigation (read more about backward navigation).


That's all.