grimdb
v2.0.0
Published
db from grimoire
Downloads
4
Readme
grimdb / sketch
This repo will contain the nodejs version. See also grimdb-go, grimdb-net. I have only spent a few hours on this so far, thus need to still shake some of the bugs out very likely.
motivation
- replace the file io in grimoire currently with a libraryized version
- learn packaging with npmjs / golang / .net core (nuget?)
- good defaults over configurability
- human readability / browsability of everything with standard tools
overview
- storage split into context/topic/item (3 levels)
- each item dir has data.json
- each context is synced separately via git (or git512)
api
- create(context)
- creates context folder if not exists
- creates README.md in context/ if not exists
- README.md initialized with # context
- git init in context
- adds 'context' to grim.json
- add to top level .gitignore
- add(context, topic, item, data)
- creates topic folder in context if not exists
- creates item folder in topic if not exists
- creates data.json in context/topic/item
- creates README.md in context/topic/item with # context/topic/item as header
- delete(context, topic, item)
- deletes folder + contents of context/topic/item
- if topic is empty folder, deletes topic
- does not delete context
- push(context)
- does a git push of the context
- git should be setup already to there
- (can I make that easier somehow?)
- pull(context)
- does a git pull of the context
- git should be setup already to there
- move(contextFrom, contextTo, topic, item, callback)
- moves topic/item from contextFrom to contextTo folder
- stash(data, filetype, context, topic, item, callback)
- saves or updates image / file to context/topic/item
- read(context, topic, item)
- returns README.md from context/topic/item
- index(context)
- creates and returns grimoire.json for given context
- grimoire(ignoreDirs)
- creates and returns grimoire.json for all contexts
- ignores contexts / folders specified by ignoreDirs = [ignore1,ignore2, ...]