🪐 Chainson is a database-backed Map with zero dependencies for Node.js
Please read the following before using: This library is still in alpha. A lot of things might change internally and to the outside of the library. I aim to keep the API the same but I'm confident some things are gonna change. It's recommended to install it and lock it on one version to avoid having it automatically grab a newer version (that could theoretically break your application).
Now we got that out of the way, let's start!
Let me show you how easy to use it is! More examples will be in the examples
folders in the (near) future!
const Chainson = require('chainson')
const chain = new Chainson()
chain.add('hello', 'world')
const world = chain.get('hello')
console.log(`Hello, ${world}!`) // Helo, world!
It's pretty easy cause we're on NPM! Simply run the following command to install the library as a dependency. We do not recommend installing it globally to ensure you use the right version in your projects.
npm i chainson
yarn add chainson
We all have worked on an application that, for example, needed a simple settings menu or has to store something based on what an user enters and just want to simply store it. Usually, this requires you to setup some sort of database (such as SQLite or even heavier databases). This can take some effort and introduces security issues if not properly implemented (such as SQL-Injection).
That's why I'm working on a library to simply store
and retrieve
data without having to set up anything or having to think about security.
Kinda, yes! But it'll be able to do much more than just storing and retrieving data. Besides that, it's a lot of fun for me learning new things while working on a project that I'm actually planning on using myself in the future.
When the database is "started", it loads the chainfile into memory. Every change to the chainfile will be saved to a json file.
It's simple! The data is stored in a Map which is kinda like a Chain and when the data is made persistent on the drive of the system it's running on it stores it as JSON
so that's where the "son" part comes from.
Moved! I'm gonna keep updating this README until all of the tasks here are done. But if you want to see new tasks or an overview of what is being worked on head over to our Github Projects board with the Tasks over here
Here follows a list of things that still need to be implemented:
Chainhistory
folder with older versions of the chain, can be "every 5 minutes" or "every change" etc.If something is [x], it doesn't mean that it's working properly. It's just means that it has been implemented. In the future I'm gonna add unit tests and make everything a lot more secure. I first want to build a base to work from.
There are a few places to find documentation for the application:
This part of the documention is mainly for myself at the moment (or people who might have release permissions in the future).
To ensure everything is formatted and linted, simply run npm run prepare-for-release
and all the things that need to be ran will be run. If there are any errors or warnings: ⚠️ DO NOT RELEASE ⚠️ and fix the issues or wait for a fix to be implemented.
This ensures everything is consistent across all releases.
If you are contributing to the project ensure you run this command before you open a pull request. There have to be no errors before we're gonna merge your pull request so everything stays consistent.
During development you probably don't want to constantly generate documentation. That's why I've added npm run fix
to make your life easier during development.
When you are ready to make a pull request make a pull request to the latest x.x.x-y
branch (ensure your branch is based on the latest version of dev to avoid any merge conflicts). Once that gets accepted it will be merged into the x.x.x-y
branch. Once a new set of features is implemented and the version is ready for release we'll merge it with master
.
In the meanwhile, I personally work on the dev
branch with my own features. There is a chance that your code get changed on the dev
branch after it has been merged for optimizations. So don't be scared if you see me changing your code :)
Refresh for a new one!
The library is released under an Apache 2.0 License.
Generated using TypeDoc