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

ag-gun

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ag-gun

Angular wrapper for Gun

  • 0.0.6
  • latest
  • Source
  • npm
  • Socket score

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

ag-Gun

Angular 6+ wrapper for Gun, a realtime, distributed, offline-first, graph database engine. Support server-side rendering.

GUN is a small, easy, and fast data sync and storage system that runs everywhere JavaScript does. The aim of GUN is to let you focus on the data that needs to stored, loaded, and shared in your app without worrying about servers, network calls, databases, or tracking offline changes or concurrency conflicts.

Install

npm i ag-gun --save

API

The AgGun service is a wrapper around the native Gun API's:

  • .opt(options)
  • .get(key)
  • .put(data)
  • .set(data)
  • .back()
  • .map(callback)
  • .open()
  • .on()
  • .once()
  • .list() ( very similar to .on, except that it gives you an array with each update.

Usage

First, import the AgGunModule with options to your AppModule:

import { AgGunModule } from 'ag-gun';

@NgModule({
  imports: [ 
      AgGunModule.forRoot({
            peers: ['https://localhost:8080/gun']
          })
   ]
})
export class AppModule { }

After adding AgGun service to your component:

import { Component } from '@angular/core';
import { AgGun } from 'ag-gun';
import { Observable } from 'rxjs';

@Component({
  selector   : 'app-root',
  templateUrl: './app.component.html',
  styleUrls  : ['./app.component.scss']
})
export class AppComponent
{
  items$: Observable<any[]>;

  constructor(private agGun: AgGun)
  {
    this.items$ = this.agGun.get('schema').list();
  }
}

Keywords

FAQs

Package last updated on 26 Nov 2018

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