New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

db-history

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

db-history

A document database companion library for storing the history of a document in a git repository

  • 2.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

db-history

This library intends to help store histories for documents. Since databases like MongoDB does not keep history of changes this library can be used as a companion library to store the documents.

It uses a git repository to store things but exposes a simple API. It requires that git is installed where it runs.

API

const { History } = require("db-history");

const history = new History("<path to my storage folder>");

// async store(id : string, blob : object, user : string) => undefined
await history.store(123, { "my stuff": "yay" }, "me");

// async revisions(id : string) => array { date : string, revision : string, action : string }
const listOfMyStuff = await history.revisions(123);

// async fetch(id : string, revision : string) => object
const myStuff = await history.fetch(123, listOfMyStuff[0].revision);

//async remove(id : string, user : string) => undefined
await history.remove(123, "me");

FAQs

Package last updated on 05 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc