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

@fieldfare/core

v1.0.0

Published

Backend framework for distributed networks

Downloads

3

Readme

Contributors Forks Stargazers Issues ISC License LinkedIn

About The Project

Product Name Screen Shot

We have built a framework to solve some of our problems with data property. Depending on big datacenters, paying for DNS and fixed IPs to store your data is not fair, but micro datacenters like the ones small businesses can have are just not stable enough for any serious task. But using many microdatacenters spread in more than one location could solve the problem, provided that they can share information between them efficiently in real time.

Fieldfare is a library that uses Distributed Hash Tables to store data in a way that cannot be corrupted by malicious nodes, and Version Control to manager users, network configuration and services definitions. This way, no central authority is necessary, since anyone in teh "admins" group can commit changes to the environment, that are replicated by all the other participants.

Main Concepts

Resources

Resource is the name given to any chunk of data that is used inside the enviroment. All resources are identified by the hash of their content. This way they can be stored anywhere and retrieved from any potentially malicious source withou the fear of data corruption.

Local Host

Any instance running Fieldfare must implement a Local Host to be able to talk to the network. A host is basically a store for a key pair that is used to sign every message generate locally. Another use of the key pair is for unique identification: every host is identified by the hash of their public key in JWK format.

Environment

The environment is an object that is kept under version control and is identified by an UUID, it can be edited by anyone that is under the "admins" group. Valid changs include adding other admins and removing itself, or editing any property of the environment (except its UUID).

The basic properties of the enviorment are its Services and lists of providers of eac service. Also there is a list of webports, that wll be explained ahead.

Services

TODO

Webports

TODO

Built With

Getting Started

Fieldfare can be used in two ways: it can run standalone using the CLI tools or you can integrate it to a larger project. Standalone services are useful to manage data and workload in the backend. When you are integrating it, usually you are building a graphical UI (an 'app' or web interface) to view and change the environment.

Prerequisites

Install the library via npm

  • npm
    npm install fieldfare

CLI Tools

The CLI tools can be used to setup a service written in javascript as a standalone server. They can also be used to configure the environment, adding or removing admins, services, authorizations and webports.

ffsetup

This tools is used to edit only the Local Host information, all changes performed here are stored locally in the folder you are currently working. All the options that this tool offers can be acessed from the menu by calling:

ffsetup

The first this to do when setting up a service is to generate the host private key. This option is accessible via 'Local Host > Generate Private Key'. This will overwrite any previosu key information, discarding it forever, so beware.

After the key is generated, the host will receive ad ID, you can copy it since this will be the identification of the host you are setting up and can be used if you are integrating to an already existing environment and will need to add an authorization.

To define the UUID of the environment, use "Environment > Set UUID". By doing this you will scrap any previous UUID defined, so if you didn't have a copy of it, beware.

The last step is to add a "Boot Webport" and is not always needed. This information is used to perform a bootstrap of the host when it is freshly configured and needs to find another enviroment participants to exchange information. If this service will be a central node, probably the other hosts will find it via its public IP that can be configured later.

ffconf

This tool is used to edit the Environment data directly. All changes performed via ffconf are propagated to all environment participants and permanently stored everywhere. Since the configuration is sotored locally, please perform this step in teh sam eworking folder where you previously called ffsetup.

To access the tool menu, you must call:

ffconf menu

TODO: Configuration steps;

ffrun <path_to_service>

This step will import a JS module that implements the service methods according to its definition. All information from ffsetup will be used to setup the host and connect to the enviroment.

Setup

In your code, import ffinit according to the platform you are using:

If you are using Node.js, you can import like this:

import {ffinit} from 'fieldfare/node';

This will also implement a WebSocket Server and a UDP Transceiver, please check the section about Webports to learn how to define the ports where the server will listen. The node setup will use LevelDB to sotre all non-volatile objects and resources used by the environment you are connecting to.

Or, if you are building for the browser, please do the following:

import {ffinit} from 'fieldfare/browser';

This will implement a WebSocket client Transceiver only, that cannot receive incomming connections. The browser setup will use IndexedDB to store all non-volatile objects and resources.

Define a UUID in string format to uniquely identify your data environment, that must be the same for all participants:

const envUUID = '3481b164-58ac-4c68-8d9a-7e3c85839ca5';

Warning: please don't use this UUID, it was randomly generated for this example only. You can generate a random UUID in any online service (https://www.uuidgenerator.net/version4) or use a library like:

npm i uuid

Now you can initilize the LocalHost and Environment like this:

var env;

try {
  ffinit.setupLocalHost();
  ffinit.setEnvironmentUUID(envUUID);
  env = ffinit.setupEnvironment();
} catch (error) {
    console.error('Fieldfare Initialization failed: ' + error);
}

Roadmap

  • [x] B-Tree Removal, done on v0.1.0
  • [ ] B-Tree Map Structure
  • [ ] Routing
  • [ ] Planning

See the open issues for a full list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the ISC License. See LICENSE.txt for more information.

Contact

Adan Kvitschal - [email protected]

Project Link: https://github.com/moduhub/fieldfare

Acknowledgments