Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bulbat

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bulbat

In-Memory storage that could be synced to encrypted file

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Bulbat

bulbat

The name is from random generated Pokémon, between Bulbasaur and Golbat.

This is in-memory quick storage that could be synced to the disk if neaded inside an encrypted file.

WARNING

The current implementation is pretty basic in terms of encryption. So don't put any sensitive data

Usage

Install the package with

npm install --save bulbat

Import and use

import { Database } from 'bulbat';

const db = new Database();

const post = {
  id: 42,
  title: 'Welcome to my blog!',
  content: '...'
};

db.collection('posts').insert(post);

db.collection('posts').data.map((post) => {
  console.log(post);
});

You could use the Collection only without the need of the Database instance:

import { Collection } from 'bulbat'

const posts = new Collection('posts');

posts.insert(/* data */);

posts.data.map((post) => {
  console.log(post)
});

The collection provide an reduce method that could be used to sort or change the content of the collection, internal state. Right now the only way to make bulk actions to the storage.

import { Collection } from 'bulbat';

const col = new Collection('posts');

// insert some data into the collection

col.reduce((result, post) => {
  if (post.status !== 'deleted') {
    result.push(post);
  }
  return result;
});

col.data
// => only posts that are not `deleted`

Development

npm install

To start development run:

npm run develop

Other commands:

# to code format the code with prettier
npm run format

# to lint the code for errors with tslint
npm run lint

# to build the project
npm run build

# to run tests
npm run test

# or
npm run test:watch

Keywords

FAQs

Package last updated on 30 Oct 2019

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